mcp

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 3 Imported by: 993

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotated added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *BlobResourceContents) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *CallToolRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequestParams added in v0.4.0

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 added in v0.4.0

func (j *CallToolRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequestParamsArguments added in v0.4.0

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 added in v0.4.0

func (j *CallToolResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *CancelledNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CancelledNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

type ClientCapabilitiesExperimental map[string]map[string]interface{}

Experimental, non-standard capabilities that the client supports.

type ClientCapabilitiesRoots added in v0.4.0

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 added in v0.4.0

type ClientCapabilitiesSampling map[string]interface{}

Present if the client supports sampling from an LLM.

type ClientNotification added in v0.4.0

type ClientNotification interface{}

type ClientRequest added in v0.4.0

type ClientRequest interface{}

type ClientResult added in v0.4.0

type ClientResult interface{}

type CompleteRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *CompleteRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParams added in v0.4.0

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 added in v0.4.0

func (j *CompleteRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParamsArgument added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *CompleteResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteResultCompletion added in v0.4.0

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 added in v0.4.0

func (j *CompleteResultCompletion) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *CreateMessageRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageRequestParams added in v0.4.0

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 added in v0.4.0

func (j *CreateMessageRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageRequestParamsIncludeContext added in v0.4.0

type CreateMessageRequestParamsIncludeContext string
const CreateMessageRequestParamsIncludeContextAllServers CreateMessageRequestParamsIncludeContext = "allServers"
const CreateMessageRequestParamsIncludeContextNone CreateMessageRequestParamsIncludeContext = "none"
const CreateMessageRequestParamsIncludeContextThisServer CreateMessageRequestParamsIncludeContext = "thisServer"

func (*CreateMessageRequestParamsIncludeContext) UnmarshalJSON added in v0.4.0

func (j *CreateMessageRequestParamsIncludeContext) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageRequestParamsMetadata added in v0.4.0

type CreateMessageRequestParamsMetadata map[string]interface{}

Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.

type CreateMessageResult added in v0.4.0

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 added in v0.4.0

func (j *CreateMessageResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultMeta added in v0.4.0

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 Cursor added in v0.4.0

type Cursor string

An opaque token used to represent a cursor for pagination.

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 added in v0.4.0

func (j *EmbeddedResource) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResourceAnnotations added in v0.4.0

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 added in v0.4.0

func (j *EmbeddedResourceAnnotations) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *GetPromptRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParams added in v0.4.0

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 added in v0.4.0

func (j *GetPromptRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParamsArguments added in v0.4.0

type GetPromptRequestParamsArguments map[string]string

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 added in v0.4.0

func (j *GetPromptResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultMeta added in v0.4.0

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 added in v0.4.0

func (j *ImageContent) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ImageContentAnnotations added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *Implementation) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *InitializeRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *InitializeResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InitializeResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *InitializedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InitializedNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *JSONRPCError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCErrorError added in v0.4.0

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 added in v0.4.0

func (j *JSONRPCErrorError) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCMessage added in v0.4.0

type JSONRPCMessage interface{}

type JSONRPCNotification added in v0.4.0

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 added in v0.4.0

func (j *JSONRPCNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *JSONRPCRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *JSONRPCResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ListPromptsRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequestParams added in v0.4.0

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 added in v0.4.0

func (j *ListPromptsResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ListResourceTemplatesRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ListResourceTemplatesResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ListResourcesRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesRequestParams added in v0.4.0

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 added in v0.4.0

func (j *ListResourcesResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ListRootsRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListRootsRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ListRootsResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListRootsResultMeta added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ListToolsRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListToolsRequestParams added in v0.4.0

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 added in v0.4.0

func (j *ListToolsResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListToolsResultMeta added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *LoggingLevel) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotification added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *LoggingMessageNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotificationParams added in v0.4.0

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 added in v0.4.0

func (j *LoggingMessageNotificationParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ModelHint added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ModelPreferences) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Notification added in v0.4.0

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 added in v0.4.0

func (j *Notification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type NotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *PaginatedRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *PingRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PingRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ProgressNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ProgressNotificationParams added in v0.4.0

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 added in v0.4.0

func (j *ProgressNotificationParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ProgressToken added in v0.4.0

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 added in v0.4.0

func (j *Prompt) UnmarshalJSON(b []byte) error

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 added in v0.4.0

func (j *PromptArgument) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PromptListChangedNotification added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *PromptListChangedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PromptListChangedNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *PromptReference) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ReadResourceRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ReadResourceResult) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultMeta added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *Request) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RequestId added in v0.4.0

type RequestId int

A uniquely identifying ID for a request in JSON-RPC.

type RequestParams added in v0.4.0

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 added in v0.4.0

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"`

	// Content
	Text string `json:"text,omitempty"`
	Blob string `json:"blob,omitempty"`
}

A known resource that the server is capable of reading.

func (*Resource) UnmarshalJSON added in v0.4.0

func (j *Resource) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceAnnotations added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ResourceContents) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotification added in v0.4.0

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 added in v0.4.0

func (j *ResourceListChangedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *ResourceReference) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceTemplate added in v0.4.0

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 added in v0.4.0

func (j *ResourceTemplate) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceTemplateAnnotations added in v0.4.0

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 added in v0.4.0

func (j *ResourceTemplateAnnotations) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotification added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ResourceUpdatedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotificationParams added in v0.4.0

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 added in v0.4.0

func (j *ResourceUpdatedNotificationParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Result added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *Role) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Root added in v0.4.0

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 added in v0.4.0

func (j *Root) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RootsListChangedNotification added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *RootsListChangedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RootsListChangedNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

type ServerCapabilitiesExperimental map[string]map[string]interface{}

Experimental, non-standard capabilities that the server supports.

type ServerCapabilitiesLogging added in v0.4.0

type ServerCapabilitiesLogging map[string]interface{}

Present if the server supports sending log messages to the client.

type ServerCapabilitiesPrompts added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

type ServerNotification interface{}

type ServerRequest added in v0.4.0

type ServerRequest interface{}

type ServerResult added in v0.4.0

type ServerResult interface{}

type SetLevelRequest added in v0.4.0

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 added in v0.4.0

func (j *SetLevelRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SetLevelRequestParams added in v0.4.0

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 added in v0.4.0

func (j *SetLevelRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequest added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *SubscribeRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequestParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *TextContent) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TextContentAnnotations added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func (j *Tool) UnmarshalJSON(b []byte) error

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"`

	// 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 added in v0.4.0

func (j *ToolInputSchema) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ToolInputSchemaProperties added in v0.4.0

type ToolInputSchemaProperties map[string]map[string]interface{}

type ToolListChangedNotification added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *ToolListChangedNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ToolListChangedNotificationParams added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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) UnmarshalJSON added in v0.4.0

func (j *UnsubscribeRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UnsubscribeRequestParams added in v0.4.0

type UnsubscribeRequestParams struct {
	// The URI of the resource to unsubscribe from.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

func (*UnsubscribeRequestParams) UnmarshalJSON added in v0.4.0

func (j *UnsubscribeRequestParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL