Documentation
¶
Index ¶
- type Annotated
- type AnnotatedAnnotations
- type BlobResourceContents
- type CallToolRequest
- type CallToolRequestParams
- type CallToolRequestParamsArguments
- type CallToolResult
- type CallToolResultMeta
- type CancelledNotification
- type CancelledNotificationParams
- type ClientCapabilities
- type ClientCapabilitiesExperimental
- type ClientCapabilitiesRoots
- type ClientCapabilitiesSampling
- type ClientNotification
- type ClientRequest
- type ClientResult
- type CompleteRequest
- type CompleteRequestParams
- type CompleteRequestParamsArgument
- type CompleteResult
- type CompleteResultCompletion
- type CompleteResultMeta
- type CreateMessageRequest
- type CreateMessageRequestParams
- type CreateMessageRequestParamsIncludeContext
- type CreateMessageRequestParamsMetadata
- type CreateMessageResult
- type CreateMessageResultMeta
- type Cursor
- type EmbeddedResource
- type EmbeddedResourceAnnotations
- type GetPromptRequest
- type GetPromptRequestParams
- type GetPromptRequestParamsArguments
- type GetPromptResult
- type GetPromptResultMeta
- type ImageContent
- type ImageContentAnnotations
- type Implementation
- type InitializeRequest
- type InitializeRequestParams
- type InitializeResult
- type InitializeResultMeta
- type InitializedNotification
- type InitializedNotificationParams
- type InitializedNotificationParamsMeta
- type JSONRPCError
- type JSONRPCErrorError
- type JSONRPCMessage
- type JSONRPCNotification
- type JSONRPCNotificationParams
- type JSONRPCNotificationParamsMeta
- type JSONRPCRequest
- type JSONRPCRequestParams
- type JSONRPCRequestParamsMeta
- type JSONRPCResponse
- type ListPromptsRequest
- type ListPromptsRequestParams
- type ListPromptsResult
- type ListPromptsResultMeta
- type ListResourceTemplatesRequest
- type ListResourceTemplatesRequestParams
- type ListResourceTemplatesResult
- type ListResourceTemplatesResultMeta
- type ListResourcesRequest
- type ListResourcesRequestParams
- type ListResourcesResult
- type ListResourcesResultMeta
- type ListRootsRequest
- type ListRootsRequestParams
- type ListRootsRequestParamsMeta
- type ListRootsResult
- type ListRootsResultMeta
- type ListToolsRequest
- type ListToolsRequestParams
- type ListToolsResult
- type ListToolsResultMeta
- type LoggingLevel
- type LoggingMessageNotification
- type LoggingMessageNotificationParams
- type ModelHint
- type ModelPreferences
- type Notification
- type NotificationParams
- type NotificationParamsMeta
- type PaginatedRequest
- type PaginatedRequestParams
- type PaginatedResult
- type PaginatedResultMeta
- type PingRequest
- type PingRequestParams
- type PingRequestParamsMeta
- type ProgressNotification
- type ProgressNotificationParams
- type ProgressToken
- type Prompt
- type PromptArgument
- type PromptListChangedNotification
- type PromptListChangedNotificationParams
- type PromptListChangedNotificationParamsMeta
- type PromptMessage
- type PromptReference
- type ReadResourceRequest
- type ReadResourceRequestParams
- type ReadResourceResult
- type ReadResourceResultMeta
- type Request
- type RequestId
- type RequestParams
- type RequestParamsMeta
- type Resource
- type ResourceAnnotations
- type ResourceContents
- type ResourceListChangedNotification
- type ResourceListChangedNotificationParams
- type ResourceListChangedNotificationParamsMeta
- type ResourceReference
- type ResourceTemplate
- type ResourceTemplateAnnotations
- type ResourceUpdatedNotification
- type ResourceUpdatedNotificationParams
- type Result
- type ResultMeta
- type Role
- type Root
- type RootsListChangedNotification
- type RootsListChangedNotificationParams
- type RootsListChangedNotificationParamsMeta
- type SamplingMessage
- type ServerCapabilities
- type ServerCapabilitiesExperimental
- type ServerCapabilitiesLogging
- type ServerCapabilitiesPrompts
- type ServerCapabilitiesResources
- type ServerCapabilitiesTools
- type ServerNotification
- type ServerRequest
- type ServerResult
- type SetLevelRequest
- type SetLevelRequestParams
- type SubscribeRequest
- type SubscribeRequestParams
- type TextContent
- type TextContentAnnotations
- type TextResourceContents
- type Tool
- type ToolInputSchema
- type ToolInputSchemaProperties
- type ToolListChangedNotification
- type ToolListChangedNotificationParams
- type ToolListChangedNotificationParamsMeta
- type UnsubscribeRequest
- type UnsubscribeRequestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotated ¶
type Annotated struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *AnnotatedAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` }
Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed
type AnnotatedAnnotations ¶
type AnnotatedAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*AnnotatedAnnotations) UnmarshalJSON ¶
func (j *AnnotatedAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BlobResourceContents ¶
type BlobResourceContents struct { // A base64-encoded string representing the binary data of the item. Blob string `json:"blob" yaml:"blob" mapstructure:"blob"` // The MIME type of this resource, if known. MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"` // The URI of this resource. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*BlobResourceContents) UnmarshalJSON ¶
func (j *BlobResourceContents) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CallToolRequest ¶
type CallToolRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params CallToolRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
Used by the client to invoke a tool provided by the server.
func (CallToolRequest) GetMethod ¶
func (r CallToolRequest) GetMethod() string
func (*CallToolRequest) UnmarshalJSON ¶
func (j *CallToolRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CallToolRequestParams ¶
type CallToolRequestParams struct { // Arguments corresponds to the JSON schema field "arguments". Arguments CallToolRequestParamsArguments `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"` // Name corresponds to the JSON schema field "name". Name string `json:"name" yaml:"name" mapstructure:"name"` }
func (*CallToolRequestParams) UnmarshalJSON ¶
func (j *CallToolRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CallToolRequestParamsArguments ¶
type CallToolRequestParamsArguments map[string]interface{}
type CallToolResult ¶
type CallToolResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta CallToolResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Content corresponds to the JSON schema field "content". Content []interface{} `json:"content" yaml:"content" mapstructure:"content"` // Whether the tool call ended in an error. // // If not set, this is assumed to be false (the call was successful). IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"` }
The server's response to a tool call.
Any errors that originate from the tool SHOULD be reported inside the result object, with `isError` set to true, _not_ as an MCP protocol-level error response. Otherwise, the LLM would not be able to see that an error occurred and self-correct.
However, any errors in _finding_ the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.
func (*CallToolResult) UnmarshalJSON ¶
func (j *CallToolResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CallToolResultMeta ¶
type CallToolResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type CancelledNotification ¶
type CancelledNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params CancelledNotificationParams `json:"params" yaml:"params" mapstructure:"params"` }
This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
This notification indicates that the result will be unused, so any associated processing SHOULD cease.
A client MUST NOT attempt to cancel its `initialize` request.
func (CancelledNotification) GetMethod ¶
func (r CancelledNotification) GetMethod() string
func (*CancelledNotification) UnmarshalJSON ¶
func (j *CancelledNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CancelledNotificationParams ¶
type CancelledNotificationParams struct { // An optional string describing the reason for the cancellation. This MAY be // logged or presented to the user. Reason *string `json:"reason,omitempty" yaml:"reason,omitempty" mapstructure:"reason,omitempty"` // The ID of the request to cancel. // // This MUST correspond to the ID of a request previously issued in the same // direction. RequestId RequestId `json:"requestId" yaml:"requestId" mapstructure:"requestId"` }
func (*CancelledNotificationParams) UnmarshalJSON ¶
func (j *CancelledNotificationParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ClientCapabilities ¶
type ClientCapabilities struct { // Experimental, non-standard capabilities that the client supports. Experimental ClientCapabilitiesExperimental `json:"experimental,omitempty" yaml:"experimental,omitempty" mapstructure:"experimental,omitempty"` // Present if the client supports listing roots. Roots *ClientCapabilitiesRoots `json:"roots,omitempty" yaml:"roots,omitempty" mapstructure:"roots,omitempty"` // Present if the client supports sampling from an LLM. Sampling ClientCapabilitiesSampling `json:"sampling,omitempty" yaml:"sampling,omitempty" mapstructure:"sampling,omitempty"` }
Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
type ClientCapabilitiesExperimental ¶
Experimental, non-standard capabilities that the client supports.
type ClientCapabilitiesRoots ¶
type ClientCapabilitiesRoots struct { // Whether the client supports notifications for changes to the roots list. ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"` }
Present if the client supports listing roots.
type ClientCapabilitiesSampling ¶
type ClientCapabilitiesSampling map[string]interface{}
Present if the client supports sampling from an LLM.
type ClientNotification ¶
type ClientNotification interface{}
type ClientRequest ¶
type ClientRequest interface{}
type ClientResult ¶
type ClientResult interface{}
type CompleteRequest ¶
type CompleteRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params CompleteRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
A request from the client to the server, to ask for completion options.
func (CompleteRequest) GetMethod ¶
func (r CompleteRequest) GetMethod() string
func (*CompleteRequest) UnmarshalJSON ¶
func (j *CompleteRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CompleteRequestParams ¶
type CompleteRequestParams struct { // The argument's information Argument CompleteRequestParamsArgument `json:"argument" yaml:"argument" mapstructure:"argument"` // Ref corresponds to the JSON schema field "ref". Ref interface{} `json:"ref" yaml:"ref" mapstructure:"ref"` }
func (*CompleteRequestParams) UnmarshalJSON ¶
func (j *CompleteRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CompleteRequestParamsArgument ¶
type CompleteRequestParamsArgument struct { // The name of the argument Name string `json:"name" yaml:"name" mapstructure:"name"` // The value of the argument to use for completion matching. Value string `json:"value" yaml:"value" mapstructure:"value"` }
The argument's information
func (*CompleteRequestParamsArgument) UnmarshalJSON ¶
func (j *CompleteRequestParamsArgument) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CompleteResult ¶
type CompleteResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta CompleteResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Completion corresponds to the JSON schema field "completion". Completion CompleteResultCompletion `json:"completion" yaml:"completion" mapstructure:"completion"` }
The server's response to a completion/complete request
func (*CompleteResult) UnmarshalJSON ¶
func (j *CompleteResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CompleteResultCompletion ¶
type CompleteResultCompletion struct { // Indicates whether there are additional completion options beyond those provided // in the current response, even if the exact total is unknown. HasMore *bool `json:"hasMore,omitempty" yaml:"hasMore,omitempty" mapstructure:"hasMore,omitempty"` // The total number of completion options available. This can exceed the number of // values actually sent in the response. Total *int `json:"total,omitempty" yaml:"total,omitempty" mapstructure:"total,omitempty"` // An array of completion values. Must not exceed 100 items. Values []string `json:"values" yaml:"values" mapstructure:"values"` }
func (*CompleteResultCompletion) UnmarshalJSON ¶
func (j *CompleteResultCompletion) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CompleteResultMeta ¶
type CompleteResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type CreateMessageRequest ¶
type CreateMessageRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params CreateMessageRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
func (CreateMessageRequest) GetMethod ¶
func (r CreateMessageRequest) GetMethod() string
func (*CreateMessageRequest) UnmarshalJSON ¶
func (j *CreateMessageRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CreateMessageRequestParams ¶
type CreateMessageRequestParams struct { // A request to include context from one or more MCP servers (including the // caller), to be attached to the prompt. The client MAY ignore this request. IncludeContext *CreateMessageRequestParamsIncludeContext `json:"includeContext,omitempty" yaml:"includeContext,omitempty" mapstructure:"includeContext,omitempty"` // The maximum number of tokens to sample, as requested by the server. The client // MAY choose to sample fewer tokens than requested. MaxTokens int `json:"maxTokens" yaml:"maxTokens" mapstructure:"maxTokens"` // Messages corresponds to the JSON schema field "messages". Messages []SamplingMessage `json:"messages" yaml:"messages" mapstructure:"messages"` // Optional metadata to pass through to the LLM provider. The format of this // metadata is provider-specific. Metadata CreateMessageRequestParamsMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"` // The server's preferences for which model to select. The client MAY ignore these // preferences. ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty" yaml:"modelPreferences,omitempty" mapstructure:"modelPreferences,omitempty"` // StopSequences corresponds to the JSON schema field "stopSequences". StopSequences []string `json:"stopSequences,omitempty" yaml:"stopSequences,omitempty" mapstructure:"stopSequences,omitempty"` // An optional system prompt the server wants to use for sampling. The client MAY // modify or omit this prompt. SystemPrompt *string `json:"systemPrompt,omitempty" yaml:"systemPrompt,omitempty" mapstructure:"systemPrompt,omitempty"` // Temperature corresponds to the JSON schema field "temperature". Temperature *float64 `json:"temperature,omitempty" yaml:"temperature,omitempty" mapstructure:"temperature,omitempty"` }
func (*CreateMessageRequestParams) UnmarshalJSON ¶
func (j *CreateMessageRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CreateMessageRequestParamsIncludeContext ¶
type CreateMessageRequestParamsIncludeContext string
const CreateMessageRequestParamsIncludeContextAllServers CreateMessageRequestParamsIncludeContext = "allServers"
const CreateMessageRequestParamsIncludeContextNone CreateMessageRequestParamsIncludeContext = "none"
const CreateMessageRequestParamsIncludeContextThisServer CreateMessageRequestParamsIncludeContext = "thisServer"
func (*CreateMessageRequestParamsIncludeContext) UnmarshalJSON ¶
func (j *CreateMessageRequestParamsIncludeContext) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CreateMessageRequestParamsMetadata ¶
type CreateMessageRequestParamsMetadata map[string]interface{}
Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
type CreateMessageResult ¶
type CreateMessageResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta CreateMessageResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Content corresponds to the JSON schema field "content". Content interface{} `json:"content" yaml:"content" mapstructure:"content"` // The name of the model that generated the message. Model string `json:"model" yaml:"model" mapstructure:"model"` // Role corresponds to the JSON schema field "role". Role Role `json:"role" yaml:"role" mapstructure:"role"` // The reason why sampling stopped, if known. StopReason *string `json:"stopReason,omitempty" yaml:"stopReason,omitempty" mapstructure:"stopReason,omitempty"` }
The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
func (*CreateMessageResult) UnmarshalJSON ¶
func (j *CreateMessageResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CreateMessageResultMeta ¶
type CreateMessageResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type EmbeddedResource ¶
type EmbeddedResource struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *EmbeddedResourceAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` // Resource corresponds to the JSON schema field "resource". Resource interface{} `json:"resource" yaml:"resource" mapstructure:"resource"` // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` }
The contents of a resource, embedded into a prompt or tool call result.
It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.
func (*EmbeddedResource) UnmarshalJSON ¶
func (j *EmbeddedResource) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type EmbeddedResourceAnnotations ¶
type EmbeddedResourceAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*EmbeddedResourceAnnotations) UnmarshalJSON ¶
func (j *EmbeddedResourceAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GetPromptRequest ¶
type GetPromptRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params GetPromptRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
Used by the client to get a prompt provided by the server.
func (GetPromptRequest) GetMethod ¶
func (r GetPromptRequest) GetMethod() string
func (*GetPromptRequest) UnmarshalJSON ¶
func (j *GetPromptRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GetPromptRequestParams ¶
type GetPromptRequestParams struct { // Arguments to use for templating the prompt. Arguments GetPromptRequestParamsArguments `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"` // The name of the prompt or prompt template. Name string `json:"name" yaml:"name" mapstructure:"name"` }
func (*GetPromptRequestParams) UnmarshalJSON ¶
func (j *GetPromptRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GetPromptRequestParamsArguments ¶
Arguments to use for templating the prompt.
type GetPromptResult ¶
type GetPromptResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta GetPromptResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An optional description for the prompt. Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // Messages corresponds to the JSON schema field "messages". Messages []PromptMessage `json:"messages" yaml:"messages" mapstructure:"messages"` }
The server's response to a prompts/get request from the client.
func (*GetPromptResult) UnmarshalJSON ¶
func (j *GetPromptResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type GetPromptResultMeta ¶
type GetPromptResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type ImageContent ¶
type ImageContent struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *ImageContentAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` // The base64-encoded image data. Data string `json:"data" yaml:"data" mapstructure:"data"` // The MIME type of the image. Different providers may support different image // types. MimeType string `json:"mimeType" yaml:"mimeType" mapstructure:"mimeType"` // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` }
An image provided to or from an LLM.
func (*ImageContent) UnmarshalJSON ¶
func (j *ImageContent) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ImageContentAnnotations ¶
type ImageContentAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*ImageContentAnnotations) UnmarshalJSON ¶
func (j *ImageContentAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Implementation ¶
type Implementation struct { // Name corresponds to the JSON schema field "name". Name string `json:"name" yaml:"name" mapstructure:"name"` // Version corresponds to the JSON schema field "version". Version string `json:"version" yaml:"version" mapstructure:"version"` }
Describes the name and version of an MCP implementation.
func (*Implementation) UnmarshalJSON ¶
func (j *Implementation) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InitializeRequest ¶
type InitializeRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params InitializeRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
This request is sent from the client to the server when it first connects, asking it to begin initialization.
func (InitializeRequest) GetMethod ¶
func (r InitializeRequest) GetMethod() string
func (*InitializeRequest) UnmarshalJSON ¶
func (j *InitializeRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InitializeRequestParams ¶
type InitializeRequestParams struct { // Capabilities corresponds to the JSON schema field "capabilities". Capabilities ClientCapabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"` // ClientInfo corresponds to the JSON schema field "clientInfo". ClientInfo Implementation `json:"clientInfo" yaml:"clientInfo" mapstructure:"clientInfo"` // The latest version of the Model Context Protocol that the client supports. The // client MAY decide to support older versions as well. ProtocolVersion string `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"` }
func (*InitializeRequestParams) UnmarshalJSON ¶
func (j *InitializeRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InitializeResult ¶
type InitializeResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta InitializeResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Capabilities corresponds to the JSON schema field "capabilities". Capabilities ServerCapabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"` // Instructions describing how to use the server and its features. // // This can be used by clients to improve the LLM's understanding of available // tools, resources, etc. It can be thought of like a "hint" to the model. For // example, this information MAY be added to the system prompt. Instructions *string `json:"instructions,omitempty" yaml:"instructions,omitempty" mapstructure:"instructions,omitempty"` // The version of the Model Context Protocol that the server wants to use. This // may not match the version that the client requested. If the client cannot // support this version, it MUST disconnect. ProtocolVersion string `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"` // ServerInfo corresponds to the JSON schema field "serverInfo". ServerInfo Implementation `json:"serverInfo" yaml:"serverInfo" mapstructure:"serverInfo"` }
After receiving an initialize request from the client, the server sends this response.
func (*InitializeResult) UnmarshalJSON ¶
func (j *InitializeResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InitializeResultMeta ¶
type InitializeResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type InitializedNotification ¶
type InitializedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *InitializedNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
This notification is sent from the client to the server after initialization has finished.
func (InitializedNotification) GetMethod ¶
func (n InitializedNotification) GetMethod() string
func (*InitializedNotification) UnmarshalJSON ¶
func (j *InitializedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InitializedNotificationParams ¶
type InitializedNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta InitializedNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type InitializedNotificationParamsMeta ¶
type InitializedNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type JSONRPCError ¶
type JSONRPCError struct { // Error corresponds to the JSON schema field "error". Error JSONRPCErrorError `json:"error" yaml:"error" mapstructure:"error"` // Id corresponds to the JSON schema field "id". Id RequestId `json:"id" yaml:"id" mapstructure:"id"` // Jsonrpc corresponds to the JSON schema field "jsonrpc". Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"` }
A response to a request that indicates an error occurred.
func (*JSONRPCError) UnmarshalJSON ¶
func (j *JSONRPCError) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type JSONRPCErrorError ¶
type JSONRPCErrorError struct { // The error type that occurred. Code int `json:"code" yaml:"code" mapstructure:"code"` // Additional information about the error. The value of this member is defined by // the sender (e.g. detailed error information, nested errors etc.). Data interface{} `json:"data,omitempty" yaml:"data,omitempty" mapstructure:"data,omitempty"` // A short description of the error. The message SHOULD be limited to a concise // single sentence. Message string `json:"message" yaml:"message" mapstructure:"message"` }
func (*JSONRPCErrorError) UnmarshalJSON ¶
func (j *JSONRPCErrorError) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type JSONRPCMessage ¶
type JSONRPCMessage interface{}
type JSONRPCNotification ¶
type JSONRPCNotification struct { // Jsonrpc corresponds to the JSON schema field "jsonrpc". Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"` // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *JSONRPCNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
A notification which does not expect a response.
func (*JSONRPCNotification) UnmarshalJSON ¶
func (j *JSONRPCNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type JSONRPCNotificationParams ¶
type JSONRPCNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta JSONRPCNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type JSONRPCNotificationParamsMeta ¶
type JSONRPCNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type JSONRPCRequest ¶
type JSONRPCRequest struct { // Id corresponds to the JSON schema field "id". Id RequestId `json:"id" yaml:"id" mapstructure:"id"` // Jsonrpc corresponds to the JSON schema field "jsonrpc". Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"` // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *JSONRPCRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
A request that expects a response.
func (*JSONRPCRequest) UnmarshalJSON ¶
func (j *JSONRPCRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type JSONRPCRequestParams ¶
type JSONRPCRequestParams struct { // Meta corresponds to the JSON schema field "_meta". Meta *JSONRPCRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type JSONRPCRequestParamsMeta ¶
type JSONRPCRequestParamsMeta struct { // If specified, the caller is requesting out-of-band progress notifications for // this request (as represented by notifications/progress). The value of this // parameter is an opaque token that will be attached to any subsequent // notifications. The receiver is not obligated to provide these notifications. ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"` }
type JSONRPCResponse ¶
type JSONRPCResponse struct { // Id corresponds to the JSON schema field "id". Id RequestId `json:"id" yaml:"id" mapstructure:"id"` // Jsonrpc corresponds to the JSON schema field "jsonrpc". Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"` // Result corresponds to the JSON schema field "result". Result Result `json:"result" yaml:"result" mapstructure:"result"` }
A successful (non-error) response to a request.
func (*JSONRPCResponse) UnmarshalJSON ¶
func (j *JSONRPCResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListPromptsRequest ¶
type ListPromptsRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ListPromptsRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
Sent from the client to request a list of prompts and prompt templates the server has.
func (ListPromptsRequest) GetMethod ¶
func (r ListPromptsRequest) GetMethod() string
func (*ListPromptsRequest) UnmarshalJSON ¶
func (j *ListPromptsRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListPromptsRequestParams ¶
type ListPromptsRequestParams struct { // An opaque token representing the current pagination position. // If provided, the server should return results starting after this cursor. Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"` }
type ListPromptsResult ¶
type ListPromptsResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ListPromptsResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An opaque token representing the pagination position after the last returned // result. // If present, there may be more results available. NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"` // Prompts corresponds to the JSON schema field "prompts". Prompts []Prompt `json:"prompts" yaml:"prompts" mapstructure:"prompts"` }
The server's response to a prompts/list request from the client.
func (*ListPromptsResult) UnmarshalJSON ¶
func (j *ListPromptsResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListPromptsResultMeta ¶
type ListPromptsResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type ListResourceTemplatesRequest ¶
type ListResourceTemplatesRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ListResourceTemplatesRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
Sent from the client to request a list of resource templates the server has.
func (ListResourceTemplatesRequest) GetMethod ¶
func (r ListResourceTemplatesRequest) GetMethod() string
func (*ListResourceTemplatesRequest) UnmarshalJSON ¶
func (j *ListResourceTemplatesRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListResourceTemplatesRequestParams ¶
type ListResourceTemplatesRequestParams struct { // An opaque token representing the current pagination position. // If provided, the server should return results starting after this cursor. Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"` }
type ListResourceTemplatesResult ¶
type ListResourceTemplatesResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ListResourceTemplatesResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An opaque token representing the pagination position after the last returned // result. // If present, there may be more results available. NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"` // ResourceTemplates corresponds to the JSON schema field "resourceTemplates". ResourceTemplates []ResourceTemplate `json:"resourceTemplates" yaml:"resourceTemplates" mapstructure:"resourceTemplates"` }
The server's response to a resources/templates/list request from the client.
func (*ListResourceTemplatesResult) UnmarshalJSON ¶
func (j *ListResourceTemplatesResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListResourceTemplatesResultMeta ¶
type ListResourceTemplatesResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type ListResourcesRequest ¶
type ListResourcesRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ListResourcesRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
Sent from the client to request a list of resources the server has.
func (ListResourcesRequest) GetMethod ¶
func (r ListResourcesRequest) GetMethod() string
func (*ListResourcesRequest) UnmarshalJSON ¶
func (j *ListResourcesRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListResourcesRequestParams ¶
type ListResourcesRequestParams struct { // An opaque token representing the current pagination position. // If provided, the server should return results starting after this cursor. Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"` }
type ListResourcesResult ¶
type ListResourcesResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ListResourcesResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An opaque token representing the pagination position after the last returned // result. // If present, there may be more results available. NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"` // Resources corresponds to the JSON schema field "resources". Resources []Resource `json:"resources" yaml:"resources" mapstructure:"resources"` }
The server's response to a resources/list request from the client.
func (*ListResourcesResult) UnmarshalJSON ¶
func (j *ListResourcesResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListResourcesResultMeta ¶
type ListResourcesResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type ListRootsRequest ¶
type ListRootsRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ListRootsRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
Sent from the server to request a list of root URIs from the client. Roots allow servers to ask for specific directories or files to operate on. A common example for roots is providing a set of repositories or directories a server should operate on.
This request is typically used when the server needs to understand the file system structure or access specific locations that the client has permission to read from.
func (ListRootsRequest) GetMethod ¶
func (r ListRootsRequest) GetMethod() string
func (*ListRootsRequest) UnmarshalJSON ¶
func (j *ListRootsRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListRootsRequestParams ¶
type ListRootsRequestParams struct { // Meta corresponds to the JSON schema field "_meta". Meta *ListRootsRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type ListRootsRequestParamsMeta ¶
type ListRootsRequestParamsMeta struct { // If specified, the caller is requesting out-of-band progress notifications for // this request (as represented by notifications/progress). The value of this // parameter is an opaque token that will be attached to any subsequent // notifications. The receiver is not obligated to provide these notifications. ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"` }
type ListRootsResult ¶
type ListRootsResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ListRootsResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Roots corresponds to the JSON schema field "roots". Roots []Root `json:"roots" yaml:"roots" mapstructure:"roots"` }
The client's response to a roots/list request from the server. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.
func (*ListRootsResult) UnmarshalJSON ¶
func (j *ListRootsResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListRootsResultMeta ¶
type ListRootsResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type ListToolsRequest ¶
type ListToolsRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ListToolsRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
Sent from the client to request a list of tools the server has.
func (ListToolsRequest) GetMethod ¶
func (r ListToolsRequest) GetMethod() string
func (*ListToolsRequest) UnmarshalJSON ¶
func (j *ListToolsRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListToolsRequestParams ¶
type ListToolsRequestParams struct { // An opaque token representing the current pagination position. // If provided, the server should return results starting after this cursor. Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"` }
type ListToolsResult ¶
type ListToolsResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ListToolsResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An opaque token representing the pagination position after the last returned // result. // If present, there may be more results available. NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"` // Tools corresponds to the JSON schema field "tools". Tools []Tool `json:"tools" yaml:"tools" mapstructure:"tools"` }
The server's response to a tools/list request from the client.
func (*ListToolsResult) UnmarshalJSON ¶
func (j *ListToolsResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ListToolsResultMeta ¶
type ListToolsResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type LoggingLevel ¶
type LoggingLevel string
const LoggingLevelAlert LoggingLevel = "alert"
const LoggingLevelCritical LoggingLevel = "critical"
const LoggingLevelDebug LoggingLevel = "debug"
const LoggingLevelEmergency LoggingLevel = "emergency"
const LoggingLevelError LoggingLevel = "error"
const LoggingLevelInfo LoggingLevel = "info"
const LoggingLevelNotice LoggingLevel = "notice"
const LoggingLevelWarning LoggingLevel = "warning"
func (LoggingLevel) GetMethod ¶
func (r LoggingLevel) GetMethod() string
func (*LoggingLevel) UnmarshalJSON ¶
func (j *LoggingLevel) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type LoggingMessageNotification ¶
type LoggingMessageNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params LoggingMessageNotificationParams `json:"params" yaml:"params" mapstructure:"params"` }
Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
func (LoggingMessageNotification) GetMethod ¶
func (r LoggingMessageNotification) GetMethod() string
func (*LoggingMessageNotification) UnmarshalJSON ¶
func (j *LoggingMessageNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type LoggingMessageNotificationParams ¶
type LoggingMessageNotificationParams struct { // The data to be logged, such as a string message or an object. Any JSON // serializable type is allowed here. Data interface{} `json:"data" yaml:"data" mapstructure:"data"` // The severity of this log message. Level LoggingLevel `json:"level" yaml:"level" mapstructure:"level"` // An optional name of the logger issuing this message. Logger *string `json:"logger,omitempty" yaml:"logger,omitempty" mapstructure:"logger,omitempty"` }
func (*LoggingMessageNotificationParams) UnmarshalJSON ¶
func (j *LoggingMessageNotificationParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ModelHint ¶
type ModelHint struct { // A hint for a model name. // // The client SHOULD treat this as a substring of a model name; for example: // - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022` // - `sonnet` should match `claude-3-5-sonnet-20241022`, // `claude-3-sonnet-20240229`, etc. // - `claude` should match any Claude model // // The client MAY also map the string to a different provider's model name or a // different model family, as long as it fills a similar niche; for example: // - `gemini-1.5-flash` could match `claude-3-haiku-20240307` Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` }
Hints to use for model selection.
Keys not declared here are currently left unspecified by the spec and are up to the client to interpret.
type ModelPreferences ¶
type ModelPreferences struct { // How much to prioritize cost when selecting a model. A value of 0 means cost // is not important, while a value of 1 means cost is the most important // factor. CostPriority *float64 `json:"costPriority,omitempty" yaml:"costPriority,omitempty" mapstructure:"costPriority,omitempty"` // Optional hints to use for model selection. // // If multiple hints are specified, the client MUST evaluate them in order // (such that the first match is taken). // // The client SHOULD prioritize these hints over the numeric priorities, but // MAY still use the priorities to select from ambiguous matches. Hints []ModelHint `json:"hints,omitempty" yaml:"hints,omitempty" mapstructure:"hints,omitempty"` // How much to prioritize intelligence and capabilities when selecting a // model. A value of 0 means intelligence is not important, while a value of 1 // means intelligence is the most important factor. IntelligencePriority *float64 `json:"intelligencePriority,omitempty" yaml:"intelligencePriority,omitempty" mapstructure:"intelligencePriority,omitempty"` // How much to prioritize sampling speed (latency) when selecting a model. A // value of 0 means speed is not important, while a value of 1 means speed is // the most important factor. SpeedPriority *float64 `json:"speedPriority,omitempty" yaml:"speedPriority,omitempty" mapstructure:"speedPriority,omitempty"` }
The server's preferences for model selection, requested of the client during sampling.
Because LLMs can vary along multiple dimensions, choosing the "best" model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This interface allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case.
These preferences are always advisory. The client MAY ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.
func (*ModelPreferences) UnmarshalJSON ¶
func (j *ModelPreferences) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Notification ¶
type Notification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *NotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
func (*Notification) UnmarshalJSON ¶
func (j *Notification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NotificationParams ¶
type NotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta NotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type NotificationParamsMeta ¶
type NotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type PaginatedRequest ¶
type PaginatedRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *PaginatedRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
func (*PaginatedRequest) UnmarshalJSON ¶
func (j *PaginatedRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PaginatedRequestParams ¶
type PaginatedRequestParams struct { // An opaque token representing the current pagination position. // If provided, the server should return results starting after this cursor. Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"` }
type PaginatedResult ¶
type PaginatedResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta PaginatedResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // An opaque token representing the pagination position after the last returned // result. // If present, there may be more results available. NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"` }
type PaginatedResultMeta ¶
type PaginatedResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type PingRequest ¶
type PingRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *PingRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
func (PingRequest) GetMethod ¶
func (r PingRequest) GetMethod() string
func (*PingRequest) UnmarshalJSON ¶
func (j *PingRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PingRequestParams ¶
type PingRequestParams struct { // Meta corresponds to the JSON schema field "_meta". Meta *PingRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type PingRequestParamsMeta ¶
type PingRequestParamsMeta struct { // If specified, the caller is requesting out-of-band progress notifications for // this request (as represented by notifications/progress). The value of this // parameter is an opaque token that will be attached to any subsequent // notifications. The receiver is not obligated to provide these notifications. ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"` }
type ProgressNotification ¶
type ProgressNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params ProgressNotificationParams `json:"params" yaml:"params" mapstructure:"params"` }
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
func (ProgressNotification) GetMethod ¶
func (r ProgressNotification) GetMethod() string
func (*ProgressNotification) UnmarshalJSON ¶
func (j *ProgressNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ProgressNotificationParams ¶
type ProgressNotificationParams struct { // The progress thus far. This should increase every time progress is made, even // if the total is unknown. Progress float64 `json:"progress" yaml:"progress" mapstructure:"progress"` // The progress token which was given in the initial request, used to associate // this notification with the request that is proceeding. ProgressToken ProgressToken `json:"progressToken" yaml:"progressToken" mapstructure:"progressToken"` // Total number of items to process (or total progress required), if known. Total *float64 `json:"total,omitempty" yaml:"total,omitempty" mapstructure:"total,omitempty"` }
func (*ProgressNotificationParams) UnmarshalJSON ¶
func (j *ProgressNotificationParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ProgressToken ¶
type ProgressToken int
A progress token, used to associate progress notifications with the original request.
type Prompt ¶
type Prompt struct { // A list of arguments to use for templating the prompt. Arguments []PromptArgument `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"` // An optional description of what this prompt provides Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The name of the prompt or prompt template. Name string `json:"name" yaml:"name" mapstructure:"name"` }
A prompt or prompt template that the server offers.
func (*Prompt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type PromptArgument ¶
type PromptArgument struct { // A human-readable description of the argument. Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The name of the argument. Name string `json:"name" yaml:"name" mapstructure:"name"` // Whether this argument must be provided. Required *bool `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"` }
Describes an argument that a prompt can accept.
func (*PromptArgument) UnmarshalJSON ¶
func (j *PromptArgument) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PromptListChangedNotification ¶
type PromptListChangedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *PromptListChangedNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
func (PromptListChangedNotification) GetMethod ¶
func (r PromptListChangedNotification) GetMethod() string
func (*PromptListChangedNotification) UnmarshalJSON ¶
func (j *PromptListChangedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PromptListChangedNotificationParams ¶
type PromptListChangedNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta PromptListChangedNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type PromptListChangedNotificationParamsMeta ¶
type PromptListChangedNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type PromptMessage ¶
type PromptMessage struct { // Content corresponds to the JSON schema field "content". Content interface{} `json:"content" yaml:"content" mapstructure:"content"` // Role corresponds to the JSON schema field "role". Role Role `json:"role" yaml:"role" mapstructure:"role"` }
Describes a message returned as part of a prompt.
This is similar to `SamplingMessage`, but also supports the embedding of resources from the MCP server.
func (*PromptMessage) UnmarshalJSON ¶
func (j *PromptMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PromptReference ¶
type PromptReference struct { // The name of the prompt or prompt template Name string `json:"name" yaml:"name" mapstructure:"name"` // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` }
Identifies a prompt.
func (*PromptReference) UnmarshalJSON ¶
func (j *PromptReference) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ReadResourceRequest ¶
type ReadResourceRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params ReadResourceRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
Sent from the client to the server, to read a specific resource URI.
func (ReadResourceRequest) GetMethod ¶
func (r ReadResourceRequest) GetMethod() string
func (*ReadResourceRequest) UnmarshalJSON ¶
func (j *ReadResourceRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ReadResourceRequestParams ¶
type ReadResourceRequestParams struct { // The URI of the resource to read. The URI can use any protocol; it is up to the // server how to interpret it. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*ReadResourceRequestParams) UnmarshalJSON ¶
func (j *ReadResourceRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ReadResourceResult ¶
type ReadResourceResult struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ReadResourceResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` // Contents corresponds to the JSON schema field "contents". Contents []interface{} `json:"contents" yaml:"contents" mapstructure:"contents"` }
The server's response to a resources/read request from the client.
func (*ReadResourceResult) UnmarshalJSON ¶
func (j *ReadResourceResult) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ReadResourceResultMeta ¶
type ReadResourceResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type Request ¶
type Request struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *RequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
func (*Request) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type RequestParams ¶
type RequestParams struct { // Meta corresponds to the JSON schema field "_meta". Meta *RequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type RequestParamsMeta ¶
type RequestParamsMeta struct { // If specified, the caller is requesting out-of-band progress notifications for // this request (as represented by notifications/progress). The value of this // parameter is an opaque token that will be attached to any subsequent // notifications. The receiver is not obligated to provide these notifications. ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"` }
type Resource ¶
type Resource struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *ResourceAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` // A description of what this resource represents. // // This can be used by clients to improve the LLM's understanding of available // resources. It can be thought of like a "hint" to the model. Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The MIME type of this resource, if known. MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"` // A human-readable name for this resource. // // This can be used by clients to populate UI elements. Name string `json:"name" yaml:"name" mapstructure:"name"` // The URI of this resource. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
A known resource that the server is capable of reading.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ResourceAnnotations ¶
type ResourceAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*ResourceAnnotations) UnmarshalJSON ¶
func (j *ResourceAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceContents ¶
type ResourceContents struct { // The MIME type of this resource, if known. MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"` // The URI of this resource. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
The contents of a specific resource or sub-resource.
func (*ResourceContents) UnmarshalJSON ¶
func (j *ResourceContents) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceListChangedNotification ¶
type ResourceListChangedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ResourceListChangedNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
func (*ResourceListChangedNotification) UnmarshalJSON ¶
func (j *ResourceListChangedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceListChangedNotificationParams ¶
type ResourceListChangedNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta ResourceListChangedNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type ResourceListChangedNotificationParamsMeta ¶
type ResourceListChangedNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type ResourceReference ¶
type ResourceReference struct { // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` // The URI or URI template of the resource. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
A reference to a resource or resource template definition.
func (*ResourceReference) UnmarshalJSON ¶
func (j *ResourceReference) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceTemplate ¶
type ResourceTemplate struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *ResourceTemplateAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` // A description of what this template is for. // // This can be used by clients to improve the LLM's understanding of available // resources. It can be thought of like a "hint" to the model. Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The MIME type for all resources that match this template. This should only be // included if all resources matching this template have the same type. MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"` // A human-readable name for the type of resource this template refers to. // // This can be used by clients to populate UI elements. Name string `json:"name" yaml:"name" mapstructure:"name"` // A URI template (according to RFC 6570) that can be used to construct resource // URIs. UriTemplate string `json:"uriTemplate" yaml:"uriTemplate" mapstructure:"uriTemplate"` }
A template description for resources available on the server.
func (*ResourceTemplate) UnmarshalJSON ¶
func (j *ResourceTemplate) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceTemplateAnnotations ¶
type ResourceTemplateAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*ResourceTemplateAnnotations) UnmarshalJSON ¶
func (j *ResourceTemplateAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceUpdatedNotification ¶
type ResourceUpdatedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params ResourceUpdatedNotificationParams `json:"params" yaml:"params" mapstructure:"params"` }
A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
func (ResourceUpdatedNotification) GetMethod ¶
func (r ResourceUpdatedNotification) GetMethod() string
func (*ResourceUpdatedNotification) UnmarshalJSON ¶
func (j *ResourceUpdatedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ResourceUpdatedNotificationParams ¶
type ResourceUpdatedNotificationParams struct { // The URI of the resource that has been updated. This might be a sub-resource of // the one that the client actually subscribed to. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*ResourceUpdatedNotificationParams) UnmarshalJSON ¶
func (j *ResourceUpdatedNotificationParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Result ¶
type Result struct { // This result property is reserved by the protocol to allow clients and servers // to attach additional metadata to their responses. Meta ResultMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type ResultMeta ¶
type ResultMeta map[string]interface{}
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
type Role ¶
type Role string
const RoleAssistant Role = "assistant"
const RoleUser Role = "user"
func (*Role) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Root ¶
type Root struct { // An optional name for the root. This can be used to provide a human-readable // identifier for the root, which may be useful for display purposes or for // referencing the root in other parts of the application. Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` // The URI identifying the root. This *must* start with file:// for now. // This restriction may be relaxed in future versions of the protocol to allow // other URI schemes. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
Represents a root directory or file that the server can operate on.
func (*Root) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type RootsListChangedNotification ¶
type RootsListChangedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *RootsListChangedNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
A notification from the client to the server, informing it that the list of roots has changed. This notification should be sent whenever the client adds, removes, or modifies any root. The server should then request an updated list of roots using the ListRootsRequest.
func (RootsListChangedNotification) GetMethod ¶
func (r RootsListChangedNotification) GetMethod() string
func (*RootsListChangedNotification) UnmarshalJSON ¶
func (j *RootsListChangedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RootsListChangedNotificationParams ¶
type RootsListChangedNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta RootsListChangedNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type RootsListChangedNotificationParamsMeta ¶
type RootsListChangedNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type SamplingMessage ¶
type SamplingMessage struct { // Content corresponds to the JSON schema field "content". Content interface{} `json:"content" yaml:"content" mapstructure:"content"` // Role corresponds to the JSON schema field "role". Role Role `json:"role" yaml:"role" mapstructure:"role"` }
Describes a message issued to or received from an LLM API.
func (*SamplingMessage) UnmarshalJSON ¶
func (j *SamplingMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ServerCapabilities ¶
type ServerCapabilities struct { // Experimental, non-standard capabilities that the server supports. Experimental ServerCapabilitiesExperimental `json:"experimental,omitempty" yaml:"experimental,omitempty" mapstructure:"experimental,omitempty"` // Present if the server supports sending log messages to the client. Logging ServerCapabilitiesLogging `json:"logging,omitempty" yaml:"logging,omitempty" mapstructure:"logging,omitempty"` // Present if the server offers any prompt templates. Prompts *ServerCapabilitiesPrompts `json:"prompts,omitempty" yaml:"prompts,omitempty" mapstructure:"prompts,omitempty"` // Present if the server offers any resources to read. Resources *ServerCapabilitiesResources `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"` // Present if the server offers any tools to call. Tools *ServerCapabilitiesTools `json:"tools,omitempty" yaml:"tools,omitempty" mapstructure:"tools,omitempty"` }
Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
type ServerCapabilitiesExperimental ¶
Experimental, non-standard capabilities that the server supports.
type ServerCapabilitiesLogging ¶
type ServerCapabilitiesLogging map[string]interface{}
Present if the server supports sending log messages to the client.
type ServerCapabilitiesPrompts ¶
type ServerCapabilitiesPrompts struct { // Whether this server supports notifications for changes to the prompt list. ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"` }
Present if the server offers any prompt templates.
type ServerCapabilitiesResources ¶
type ServerCapabilitiesResources struct { // Whether this server supports notifications for changes to the resource list. ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"` // Whether this server supports subscribing to resource updates. Subscribe *bool `json:"subscribe,omitempty" yaml:"subscribe,omitempty" mapstructure:"subscribe,omitempty"` }
Present if the server offers any resources to read.
type ServerCapabilitiesTools ¶
type ServerCapabilitiesTools struct { // Whether this server supports notifications for changes to the tool list. ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"` }
Present if the server offers any tools to call.
type ServerNotification ¶
type ServerNotification interface{}
type ServerRequest ¶
type ServerRequest interface{}
type ServerResult ¶
type ServerResult interface{}
type SetLevelRequest ¶
type SetLevelRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params SetLevelRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
A request from the client to the server, to enable or adjust logging.
func (*SetLevelRequest) UnmarshalJSON ¶
func (j *SetLevelRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SetLevelRequestParams ¶
type SetLevelRequestParams struct { // The level of logging that the client wants to receive from the server. The // server should send all logs at this level and higher (i.e., more severe) to the // client as notifications/logging/message. Level LoggingLevel `json:"level" yaml:"level" mapstructure:"level"` }
func (*SetLevelRequestParams) UnmarshalJSON ¶
func (j *SetLevelRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SubscribeRequest ¶
type SubscribeRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params SubscribeRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
func (SubscribeRequest) GetMethod ¶
func (r SubscribeRequest) GetMethod() string
func (*SubscribeRequest) UnmarshalJSON ¶
func (j *SubscribeRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SubscribeRequestParams ¶
type SubscribeRequestParams struct { // The URI of the resource to subscribe to. The URI can use any protocol; it is up // to the server how to interpret it. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*SubscribeRequestParams) UnmarshalJSON ¶
func (j *SubscribeRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TextContent ¶
type TextContent struct { // Annotations corresponds to the JSON schema field "annotations". Annotations *TextContentAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"` // The text content of the message. Text string `json:"text" yaml:"text" mapstructure:"text"` // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` }
Text provided to or from an LLM.
func (*TextContent) UnmarshalJSON ¶
func (j *TextContent) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TextContentAnnotations ¶
type TextContentAnnotations struct { // Describes who the intended customer of this object or data is. // // It can include multiple entries to indicate content useful for multiple // audiences (e.g., `["user", "assistant"]`). Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"` // Describes how important this data is for operating the server. // // A value of 1 means "most important," and indicates that the data is // effectively required, while 0 means "least important," and indicates that // the data is entirely optional. Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"` }
func (*TextContentAnnotations) UnmarshalJSON ¶
func (j *TextContentAnnotations) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TextResourceContents ¶
type TextResourceContents struct { // The MIME type of this resource, if known. MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"` // The text of the item. This must only be set if the item can actually be // represented as text (not binary data). Text string `json:"text" yaml:"text" mapstructure:"text"` // The URI of this resource. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*TextResourceContents) UnmarshalJSON ¶
func (j *TextResourceContents) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Tool ¶
type Tool struct { // A human-readable description of the tool. Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // A JSON Schema object defining the expected parameters for the tool. InputSchema ToolInputSchema `json:"inputSchema" yaml:"inputSchema" mapstructure:"inputSchema"` // The name of the tool. Name string `json:"name" yaml:"name" mapstructure:"name"` }
Definition for a tool the client can call.
func (*Tool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ToolInputSchema ¶
type ToolInputSchema struct { // Properties corresponds to the JSON schema field "properties". Properties ToolInputSchemaProperties `json:"properties,omitempty" yaml:"properties,omitempty" mapstructure:"properties,omitempty"` // Required corresponds to the JSON schema field "required". Required []string `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"` // Type corresponds to the JSON schema field "type". Type string `json:"type" yaml:"type" mapstructure:"type"` }
A JSON Schema object defining the expected parameters for the tool.
func (*ToolInputSchema) UnmarshalJSON ¶
func (j *ToolInputSchema) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ToolListChangedNotification ¶
type ToolListChangedNotification struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params *ToolListChangedNotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` }
An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
func (ToolListChangedNotification) GetMethod ¶
func (r ToolListChangedNotification) GetMethod() string
func (*ToolListChangedNotification) UnmarshalJSON ¶
func (j *ToolListChangedNotification) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ToolListChangedNotificationParams ¶
type ToolListChangedNotificationParams struct { // This parameter name is reserved by MCP to allow clients and servers to attach // additional metadata to their notifications. Meta ToolListChangedNotificationParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` }
type ToolListChangedNotificationParamsMeta ¶
type ToolListChangedNotificationParamsMeta map[string]interface{}
This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
type UnsubscribeRequest ¶
type UnsubscribeRequest struct { // Method corresponds to the JSON schema field "method". Method string `json:"method" yaml:"method" mapstructure:"method"` // Params corresponds to the JSON schema field "params". Params UnsubscribeRequestParams `json:"params" yaml:"params" mapstructure:"params"` }
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
func (UnsubscribeRequest) GetMethod ¶
func (r UnsubscribeRequest) GetMethod() string
func (*UnsubscribeRequest) UnmarshalJSON ¶
func (j *UnsubscribeRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type UnsubscribeRequestParams ¶
type UnsubscribeRequestParams struct { // The URI of the resource to unsubscribe from. Uri string `json:"uri" yaml:"uri" mapstructure:"uri"` }
func (*UnsubscribeRequestParams) UnmarshalJSON ¶
func (j *UnsubscribeRequestParams) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.