@@ -478,179 +478,6 @@ type BlobResourceContents struct {
478
478
Blob string `json:"blob"`
479
479
}
480
480
481
- /* Prompts */
482
-
483
- // ListPromptsRequest is sent from the client to request a list of prompts and
484
- // prompt templates the server has.
485
- type ListPromptsRequest struct {
486
- PaginatedRequest
487
- }
488
-
489
- // ListPromptsResult is the server's response to a prompts/list request from
490
- // the client.
491
- type ListPromptsResult struct {
492
- PaginatedResult
493
- Prompts []Prompt `json:"prompts"`
494
- }
495
-
496
- // GetPromptRequest is used by the client to get a prompt provided by the
497
- // server.
498
- type GetPromptRequest struct {
499
- Request
500
- Params struct {
501
- // The name of the prompt or prompt template.
502
- Name string `json:"name"`
503
- // Arguments to use for templating the prompt.
504
- Arguments map [string ]string `json:"arguments,omitempty"`
505
- } `json:"params"`
506
- }
507
-
508
- // GetPromptResult is the server's response to a prompts/get request from the
509
- // client.
510
- type GetPromptResult struct {
511
- Result
512
- // An optional description for the prompt.
513
- Description string `json:"description,omitempty"`
514
- Messages []PromptMessage `json:"messages"`
515
- }
516
-
517
- // Prompt represents a prompt or prompt template that the server offers.
518
- // If Arguments is non-nil and non-empty, this indicates the prompt is a template
519
- // that requires argument values to be provided when calling prompts/get.
520
- // If Arguments is nil or empty, this is a static prompt that takes no arguments.
521
- type Prompt struct {
522
- // The name of the prompt or prompt template.
523
- Name string `json:"name"`
524
- // An optional description of what this prompt provides
525
- Description string `json:"description,omitempty"`
526
- // A list of arguments to use for templating the prompt.
527
- // The presence of arguments indicates this is a template prompt.
528
- Arguments []PromptArgument `json:"arguments,omitempty"`
529
- }
530
-
531
- // PromptArgument describes an argument that a prompt template can accept.
532
- // When a prompt includes arguments, clients must provide values for all
533
- // required arguments when making a prompts/get request.
534
- type PromptArgument struct {
535
- // The name of the argument.
536
- Name string `json:"name"`
537
- // A human-readable description of the argument.
538
- Description string `json:"description,omitempty"`
539
- // Whether this argument must be provided.
540
- // If true, clients must include this argument when calling prompts/get.
541
- Required bool `json:"required,omitempty"`
542
- }
543
-
544
- // Role represents the sender or recipient of messages and data in a
545
- // conversation.
546
- type Role string
547
-
548
- const (
549
- RoleUser Role = "user"
550
- RoleAssistant Role = "assistant"
551
- )
552
-
553
- // PromptMessage describes a message returned as part of a prompt.
554
- //
555
- // This is similar to `SamplingMessage`, but also supports the embedding of
556
- // resources from the MCP server.
557
- type PromptMessage struct {
558
- Role Role `json:"role"`
559
- Content interface {} `json:"content"` // Can be TextContent, ImageContent, or EmbeddedResource
560
- }
561
-
562
- // EmbeddedResource represents the contents of a resource, embedded into a prompt or tool call result.
563
- //
564
- // It is up to the client how best to render embedded resources for the
565
- // benefit of the LLM and/or the user.
566
- type EmbeddedResource struct {
567
- Annotated
568
- Type string `json:"type"`
569
- Resource ResourceContents `json:"resource"`
570
- }
571
-
572
- // PromptListChangedNotification is an optional notification from the server
573
- // to the client, informing it that the list of prompts it offers has changed. This
574
- // may be issued by servers without any previous subscription from the client.
575
- type PromptListChangedNotification struct {
576
- Notification
577
- }
578
-
579
- /* Tools */
580
-
581
- // ListToolsRequest is sent from the client to request a list of tools the
582
- // server has.
583
- type ListToolsRequest struct {
584
- PaginatedRequest
585
- }
586
-
587
- // ListToolsResult is the server's response to a tools/list request from the
588
- // client.
589
- type ListToolsResult struct {
590
- PaginatedResult
591
- Tools []Tool `json:"tools"`
592
- }
593
-
594
- // CallToolResult is the server's response to a tool call.
595
- //
596
- // Any errors that originate from the tool SHOULD be reported inside the result
597
- // object, with `isError` set to true, _not_ as an MCP protocol-level error
598
- // response. Otherwise, the LLM would not be able to see that an error occurred
599
- // and self-correct.
600
- //
601
- // However, any errors in _finding_ the tool, an error indicating that the
602
- // server does not support tool calls, or any other exceptional conditions,
603
- // should be reported as an MCP error response.
604
- type CallToolResult struct {
605
- Result
606
- Content []interface {} `json:"content"` // Can be TextContent, ImageContent, or EmbeddedResource
607
- // Whether the tool call ended in an error.
608
- //
609
- // If not set, this is assumed to be false (the call was successful).
610
- IsError bool `json:"isError,omitempty"`
611
- }
612
-
613
- // CallToolRequest is used by the client to invoke a tool provided by the server.
614
- type CallToolRequest struct {
615
- Request
616
- Params struct {
617
- Name string `json:"name"`
618
- Arguments map [string ]interface {} `json:"arguments,omitempty"`
619
- Meta * struct {
620
- // If specified, the caller is requesting out-of-band progress
621
- // notifications for this request (as represented by
622
- // notifications/progress). The value of this parameter is an
623
- // opaque token that will be attached to any subsequent
624
- // notifications. The receiver is not obligated to provide these
625
- // notifications.
626
- ProgressToken ProgressToken `json:"progressToken,omitempty"`
627
- } `json:"_meta,omitempty"`
628
- } `json:"params"`
629
- }
630
-
631
- // ToolListChangedNotification is an optional notification from the server to
632
- // the client, informing it that the list of tools it offers has changed. This may
633
- // be issued by servers without any previous subscription from the client.
634
- type ToolListChangedNotification struct {
635
- Notification
636
- }
637
-
638
- // Tool represents the definition for a tool the client can call.
639
- type Tool struct {
640
- // The name of the tool.
641
- Name string `json:"name"`
642
- // A human-readable description of the tool.
643
- Description string `json:"description,omitempty"`
644
- // A JSON Schema object defining the expected parameters for the tool.
645
- InputSchema ToolInputSchema `json:"inputSchema"`
646
- }
647
-
648
- type ToolInputSchema struct {
649
- Type string `json:"type"`
650
- Properties map [string ]interface {} `json:"properties,omitempty"`
651
- Required []string `json:"required,omitempty"`
652
- }
653
-
654
481
/* Logging */
655
482
656
483
// SetLevelRequest is a request from the client to the server, to enable or
0 commit comments