schema

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 46

Documentation

Overview

Package schema hosts the Go types that mirror the *Model Context Protocol* (MCP) JSON schema.

All request / response / notification payloads, helper enumerations and method constants are generated from the authoritative protocol definition and live in this package so that servers and clients can share a single, strongly-typed contract layer.

The version of the JSON schema that the generated files correspond to is exposed via the LatestProtocolVersion constant.

Index

Constants

View Source
const (
	ElicitRequestParamsModeForm ElicitRequestParamsMode = "form"
	ElicitRequestParamsModeUrl  ElicitRequestParamsMode = "url"

	TaskStatusWorking       = legacy.TaskStatusWorking
	TaskStatusInputRequired = legacy.TaskStatusInputRequired
	TaskStatusCompleted     = legacy.TaskStatusCompleted
	TaskStatusFailed        = legacy.TaskStatusFailed
	TaskStatusCancelled     = legacy.TaskStatusCancelled

	ToolExecutionTaskSupportForbidden = legacy.ToolExecutionTaskSupportForbidden
	ToolExecutionTaskSupportOptional  = legacy.ToolExecutionTaskSupportOptional
	ToolExecutionTaskSupportRequired  = legacy.ToolExecutionTaskSupportRequired
)

Deprecated: legacy enum values are retained for source compatibility.

View Source
const (
	// LatestProtocolVersion is the preferred protocol when both peers support it.
	LatestProtocolVersion = "2026-07-28"
	// LegacyProtocolVersion is retained for explicit negotiated downgrade.
	LegacyProtocolVersion   = "2025-11-25"
	TokenProgressContextKey = tokenProgress("TokenProgress")
	McpSessionContextKey    = mcpSessionId("MCPSessionId")
)
View Source
const (
	// Unauthorized indicates authentication is required
	Unauthorized = -32001
	// ResourceNotFound indicates the requested resource was not found
	ResourceNotFound = -32002
)
View Source
const (
	HeaderProtocolVersion = "Mcp-Protocol-Version"
	HeaderMethod          = "Mcp-Method"
	HeaderName            = "Mcp-Name"
	HeaderParamPrefix     = "Mcp-Param-"
)

Standard Streamable HTTP headers introduced by the 2026-07-28 protocol.

View Source
const (
	ErrorCodeHeaderMismatch             = -32020
	ErrorCodeUnsupportedProtocolVersion = -32022
)

Standard protocol error codes used while validating HTTP requests.

View Source
const (
	MethodServerDiscover                        = "server/discover"
	MethodInitialize                            = "initialize"
	MethodPing                                  = "ping"
	MethodResourcesList                         = "resources/list"
	MethodResourcesTemplatesList                = "resources/templates/list"
	MethodResourcesRead                         = "resources/read"
	MethodSubscribe                             = "resources/subscribe"
	MethodUnsubscribe                           = "resources/unsubscribe"
	MethodPromptsList                           = "prompts/list"
	MethodPromptsGet                            = "prompts/get"
	MethodToolsList                             = "tools/list"
	MethodToolsCall                             = "tools/call"
	MethodComplete                              = "complete"
	MethodLoggingSetLevel                       = "logging/setLevel"
	MethodNotificationInitialized               = "notifications/initialized"
	MethodNotificationResourceUpdated           = "notifications/resources/updated"
	MethodNotificationMessage                   = "notifications/message"
	MethodNotificationCancel                    = "cancel"
	MethodNotificationCanceled                  = "notifications/cancelled"
	MethodNotificationProgress                  = "notifications/progress"
	MethodNotificationSubscriptionsAcknowledged = "notifications/subscriptions/acknowledged"
	MethodRootsList                             = "roots/list"
	MethodSamplingCreateMessage                 = "sampling/createMessage"
	MethodElicitationCreate                     = "elicitation/create"
	MethodSubscriptionsListen                   = "subscriptions/listen"
)

JSON-RPC method names for MCP protocol

View Source
const (
	ResultTypeComplete      = "complete"
	ResultTypeInputRequired = "input_required"
)

Variables

View Source
var SupportedProtocolVersions = []string{LatestProtocolVersion, LegacyProtocolVersion}

SupportedProtocolVersions is ordered by preference.

Functions

func IsProtocolNewer added in v0.3.8

func IsProtocolNewer(current, reference string) bool

IsProtocolNewer returns true if `current` represents a later protocol date than `reference`. The date strings must be in ISO layout "YYYY-MM-DD". If either value cannot be parsed the function returns false.

Example:

IsProtocolNewer("2025-06-21", "2025-03-26") == true

func MustParseParams

func MustParseParams[T any](req *jsonrpc.Request, resp *jsonrpc.Response, v *T) bool

MustParseParams parses JSON-RPC request parameters into the provided struct.

func NewInvalidPromptName

func NewInvalidPromptName(name string) *jsonrpc.Error

NewInvalidPromptName creates a new invalid prompt name

func NewResourceNotFound

func NewResourceNotFound(uri string) *jsonrpc.Error

NewResourceNotFound creates a new resource not found

func NewUnknownTool

func NewUnknownTool(toolName string) *jsonrpc.Error

Types

type Annotations

type Annotations struct {
	// Describes who the intended audience 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"`

	// The moment the resource was last modified, as an ISO 8601 formatted string.
	//
	// Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
	//
	// Examples: last activity timestamp in an open file, timestamp when the resource
	// was attached, etc.
	LastModified *string `json:"lastModified,omitempty" yaml:"lastModified,omitempty" mapstructure:"lastModified,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"`
}

Optional annotations for the client. The client can use annotations to inform how objects are used or displayed

func (*Annotations) UnmarshalJSON

func (j *Annotations) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AudioContent

type AudioContent struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"`

	// The base64-encoded audio data.
	Data string `json:"data" yaml:"data" mapstructure:"data"`

	// The MIME type of the audio. Different providers may support different audio
	// 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"`
}

Audio provided to or from an LLM.

func (*AudioContent) UnmarshalJSON

func (j *AudioContent) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BaseMetadata added in v0.5.0

type BaseMetadata struct {
	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`
}

Base interface for metadata with name (identifier) and title (display name) properties.

func (*BaseMetadata) UnmarshalJSON added in v0.5.0

func (j *BaseMetadata) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BlobResourceContents

type BlobResourceContents struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BooleanSchema added in v0.5.0

type BooleanSchema struct {
	// Default corresponds to the JSON schema field "default".
	Default *bool `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Description corresponds to the JSON schema field "description".
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Title corresponds to the JSON schema field "title".
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

func (*BooleanSchema) UnmarshalJSON added in v0.5.0

func (j *BooleanSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CacheableResult added in v0.15.0

type CacheableResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope CacheableResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

A result that supports a time-to-live (TTL) hint for client-side caching.

func (*CacheableResult) UnmarshalJSON added in v0.15.0

func (j *CacheableResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CacheableResultCacheScope added in v0.15.0

type CacheableResultCacheScope string
const CacheableResultCacheScopePrivate CacheableResultCacheScope = "private"
const CacheableResultCacheScopePublic CacheableResultCacheScope = "public"

func (*CacheableResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *CacheableResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequest

type CallToolRequest 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 CallToolRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Used by the client to invoke a tool provided by the server.

func (*CallToolRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequestParams

type CallToolRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// Arguments to use for the tool call.
	Arguments map[string]interface{} `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"`

	// InputResponses corresponds to the JSON schema field "inputResponses".
	InputResponses map[string]interface{} `json:"inputResponses,omitempty" yaml:"inputResponses,omitempty" mapstructure:"inputResponses,omitempty"`

	// The name of the tool.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`
}

Parameters for a `tools/call` request.

func NewCallToolRequestParams

func NewCallToolRequestParams[T any](name string, cmd T) (*CallToolRequestParams, error)

NewCallToolRequestParams creates a new CallToolRequestParams instance from a command struct.

func (*CallToolRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequestParamsMeta deprecated added in v0.8.0

type CallToolRequestParamsMeta = legacy.CallToolRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CallToolResult

type CallToolResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// A list of content objects that represent the unstructured result of the tool
	// call.
	Content []CallToolResultContentElem `json:"content" yaml:"content" mapstructure:"content"`

	// InputRequests and RequestState are populated when ResultType is
	// "input_required". They mirror the July response union while preserving
	// the historical CallToolResult API.
	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`
	RequestState  *string                `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Whether the tool call ended in an error.
	//
	// If not set, this is assumed to be false (the call was successful).
	//
	// 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.
	IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// An optional JSON value that represents the structured result of the tool call.
	//
	// This can be any JSON value (object, array, string, number, boolean, or null)
	// that conforms to the tool's outputSchema if one is defined.
	StructuredContent interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`
}

The result returned by the server for a {@link CallToolRequesttools/call} request.

func (*CallToolResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultContentElem

type CallToolResultContentElem interface{}

type CallToolResultResponse added in v0.15.0

type CallToolResultResponse 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 CallToolResultResponseResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link CallToolRequesttools/call} request.

func (*CallToolResultResponse) UnmarshalJSON added in v0.15.0

func (j *CallToolResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultResponseResult added in v0.15.0

type CallToolResultResponseResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// A list of content objects that represent the unstructured result of the tool
	// call.
	Content []CallToolResultContentElem `json:"content" yaml:"content" mapstructure:"content"`

	// InputRequests corresponds to the JSON schema field "inputRequests".
	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`

	// Whether the tool call ended in an error.
	//
	// If not set, this is assumed to be false (the call was successful).
	//
	// 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.
	IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// An optional JSON value that represents the structured result of the tool call.
	//
	// This can be any JSON value (object, array, string, number, boolean, or null)
	// that conforms to the tool's outputSchema if one is defined.
	StructuredContent interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`
}

An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.

At least one of `inputRequests` or `requestState` MUST be present.

func (*CallToolResultResponseResult) UnmarshalJSON added in v0.15.0

func (j *CallToolResultResponseResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultResponseResult_0 added in v0.15.0

type CallToolResultResponseResult_0 = InputRequiredResult

type CallToolResultResponseResult_1 added in v0.15.0

type CallToolResultResponseResult_1 = CallToolResult

type CancelTaskRequest deprecated added in v0.8.0

type CancelTaskRequest = legacy.CancelTaskRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CancelTaskRequestParams deprecated added in v0.8.0

type CancelTaskRequestParams = legacy.CancelTaskRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CancelTaskResult deprecated added in v0.8.0

type CancelTaskResult = legacy.CancelTaskResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CancelledNotification

type CancelledNotification 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 CancelledNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

This notification is sent by the client to indicate that it is cancelling a request it previously issued.

On stdio, the server also sends this notification, solely to terminate a {@link SubscriptionsListenRequestsubscriptions/listen} stream: it references the ID of the `subscriptions/listen` request that opened the stream. Servers MUST NOT use this notification to cancel any other 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.

func (*CancelledNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CancelledNotificationParams

type CancelledNotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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 the client previously issued.
	RequestId *RequestId `json:"requestId,omitempty" yaml:"requestId,omitempty" mapstructure:"requestId,omitempty"`
}

Parameters for a `notifications/cancelled` notification.

func (*CancelledNotificationParams) UnmarshalJSON

func (j *CancelledNotificationParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ClientCapabilities

type ClientCapabilities struct {
	// Present if the client supports elicitation from the server.
	Elicitation *ClientCapabilitiesElicitation `json:"elicitation,omitempty" yaml:"elicitation,omitempty" mapstructure:"elicitation,omitempty"`

	// Experimental, non-standard capabilities that the client supports.
	Experimental map[string]map[string]interface{} `json:"experimental,omitempty" yaml:"experimental,omitempty" mapstructure:"experimental,omitempty"`

	// Optional MCP extensions that the client supports. Keys are extension
	// identifiers
	// (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are
	// per-extension settings objects. An empty object indicates support with no
	// settings.
	//
	// Keys MUST follow the {@link MetaObject`_meta` key naming rules}, with a
	// mandatory prefix.
	Extensions map[string]map[string]interface{} `json:"extensions,omitempty" yaml:"extensions,omitempty" mapstructure:"extensions,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"`

	// Tasks is retained for negotiated 2025-11-25 compatibility. July tasks are
	// negotiated through Extensions instead.
	Tasks *ClientCapabilitiesTasks `json:"tasks,omitempty" yaml:"tasks,omitempty" mapstructure:"tasks,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 ClientCapabilitiesElicitation added in v0.8.0

type ClientCapabilitiesElicitation struct {
	// Form corresponds to the JSON schema field "form".
	Form map[string]interface{} `json:"form,omitempty" yaml:"form,omitempty" mapstructure:"form,omitempty"`

	// Url corresponds to the JSON schema field "url".
	Url map[string]interface{} `json:"url,omitempty" yaml:"url,omitempty" mapstructure:"url,omitempty"`
}

Present if the client supports elicitation from the server.

type ClientCapabilitiesRoots deprecated

type ClientCapabilitiesRoots = legacy.ClientCapabilitiesRoots

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ClientCapabilitiesSampling

type ClientCapabilitiesSampling struct {
	// Whether the client supports context inclusion via `includeContext` parameter.
	// If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
	Context map[string]interface{} `json:"context,omitempty" yaml:"context,omitempty" mapstructure:"context,omitempty"`

	// Whether the client supports tool use via `tools` and `toolChoice` parameters.
	Tools map[string]interface{} `json:"tools,omitempty" yaml:"tools,omitempty" mapstructure:"tools,omitempty"`
}

Present if the client supports sampling from an LLM.

type ClientCapabilitiesTasks deprecated added in v0.8.0

type ClientCapabilitiesTasks = legacy.ClientCapabilitiesTasks

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ClientCapabilitiesTasksRequests deprecated added in v0.8.0

type ClientCapabilitiesTasksRequests = legacy.ClientCapabilitiesTasksRequests

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ClientCapabilitiesTasksRequestsElicitation deprecated added in v0.8.0

type ClientCapabilitiesTasksRequestsElicitation = legacy.ClientCapabilitiesTasksRequestsElicitation

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ClientCapabilitiesTasksRequestsSampling deprecated added in v0.8.0

type ClientCapabilitiesTasksRequestsSampling = legacy.ClientCapabilitiesTasksRequestsSampling

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ClientNotification

type ClientNotification 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 CancelledNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

This notification is sent by the client to indicate that it is cancelling a request it previously issued.

On stdio, the server also sends this notification, solely to terminate a {@link SubscriptionsListenRequestsubscriptions/listen} stream: it references the ID of the `subscriptions/listen` request that opened the stream. Servers MUST NOT use this notification to cancel any other 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.

func (*ClientNotification) UnmarshalJSON added in v0.15.0

func (j *ClientNotification) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ClientRequest

type ClientRequest interface{}

type ClientResult deprecated

type ClientResult = legacy.ClientResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CompleteRequest

type CompleteRequest 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 CompleteRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

A request from the client to the server, to ask for completion options.

func (*CompleteRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParams

type CompleteRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// The argument's information
	Argument CompleteRequestParamsArgument `json:"argument" yaml:"argument" mapstructure:"argument"`

	// Additional, optional context for completions
	Context *CompleteRequestParamsContext `json:"context,omitempty" yaml:"context,omitempty" mapstructure:"context,omitempty"`

	// Ref corresponds to the JSON schema field "ref".
	Ref CompleteRequestParamsRef `json:"ref" yaml:"ref" mapstructure:"ref"`
}

Parameters for a `completion/complete` request.

func (*CompleteRequestParams) UnmarshalJSON

func (j *CompleteRequestParams) UnmarshalJSON(value []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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParamsContext added in v0.5.0

type CompleteRequestParamsContext struct {
	// Previously-resolved variables in a URI template or prompt.
	Arguments map[string]string `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"`
}

Additional, optional context for completions

type CompleteRequestParamsMeta deprecated added in v0.8.0

type CompleteRequestParamsMeta = legacy.CompleteRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CompleteRequestParamsRef

type CompleteRequestParamsRef struct {
	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

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

Identifies a prompt.

func (*CompleteRequestParamsRef) UnmarshalJSON

func (j *CompleteRequestParamsRef) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParamsRef_0

type CompleteRequestParamsRef_0 = PromptReference

type CompleteRequestParamsRef_1

type CompleteRequestParamsRef_1 = ResourceTemplateReference

type CompleteResult

type CompleteResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `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"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

The result returned by the server for a {@link CompleteRequestcompletion/complete} request.

func (*CompleteResult) UnmarshalJSON

func (j *CompleteResult) UnmarshalJSON(value []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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CompleteResultResponse added in v0.15.0

type CompleteResultResponse 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 CompleteResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link CompleteRequestcompletion/complete} request.

func (*CompleteResultResponse) UnmarshalJSON added in v0.15.0

func (j *CompleteResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ContentBlock added in v0.5.0

type ContentBlock interface{}

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) UnmarshalJSON

func (j *CreateMessageRequest) UnmarshalJSON(value []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.
	//
	// Default is `"none"`. The values `"thisServer"` and `"allServers"` are
	// deprecated (SEP-2596): servers SHOULD
	// omit this field or use `"none"`, and SHOULD only use the deprecated values if
	// the client declares
	// {@link ClientCapabilities.sampling.context}.
	IncludeContext *CreateMessageRequestParamsIncludeContext `json:"includeContext,omitempty" yaml:"includeContext,omitempty" mapstructure:"includeContext,omitempty"`

	// The requested maximum number of tokens to sample (to prevent runaway
	// completions).
	//
	// The client MAY choose to sample fewer tokens than the requested maximum.
	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 map[string]interface{} `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"`

	// Controls how the model uses tools.
	// The client MUST return an error if this field is provided but {@link
	// ClientCapabilities.sampling.tools} is not declared.
	// Default is `{ mode: "auto" }`.
	ToolChoice *ToolChoice `json:"toolChoice,omitempty" yaml:"toolChoice,omitempty" mapstructure:"toolChoice,omitempty"`

	// Tools that the model may use during generation.
	// The client MUST return an error if this field is provided but {@link
	// ClientCapabilities.sampling.tools} is not declared.
	Tools []Tool `json:"tools,omitempty" yaml:"tools,omitempty" mapstructure:"tools,omitempty"`
}

Parameters for a `sampling/createMessage` request.

func (*CreateMessageRequestParams) UnmarshalJSON

func (j *CreateMessageRequestParams) UnmarshalJSON(value []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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageRequestParamsMeta deprecated added in v0.8.0

type CreateMessageRequestParamsMeta = legacy.CreateMessageRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type CreateMessageResult

type CreateMessageResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Content corresponds to the JSON schema field "content".
	Content CreateMessageResultContent `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.
	//
	// Standard values:
	// - `"endTurn"`: Natural end of the assistant's turn
	// - `"stopSequence"`: A stop sequence was encountered
	// - `"maxTokens"`: Maximum token limit was reached
	// - `"toolUse"`: The model wants to use one or more tools
	//
	// This field is an open string to allow for provider-specific stop reasons.
	StopReason *string `json:"stopReason,omitempty" yaml:"stopReason,omitempty" mapstructure:"stopReason,omitempty"`
}

The result returned by the client for a {@link CreateMessageRequestsampling/createMessage} request. 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent

type CreateMessageResultContent struct {
	// Optional metadata about the tool use. Clients SHOULD preserve this field when
	// including tool uses in subsequent sampling requests to enable caching
	// optimizations.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"`

	// The unstructured result content of the tool use.
	//
	// This has the same format as {@link CallToolResult.content} and can include
	// text, images,
	// audio, resource links, and embedded resources.
	Content []ToolResultContentContentElem `json:"content" yaml:"content" mapstructure:"content"`

	// The base64-encoded image data.
	Data string `json:"data" yaml:"data" mapstructure:"data"`

	// A unique identifier for this tool use.
	//
	// This ID is used to match tool results to their corresponding tool uses.
	Id string `json:"id" yaml:"id" mapstructure:"id"`

	// The arguments to pass to the tool, conforming to the tool's input schema.
	Input map[string]interface{} `json:"input" yaml:"input" mapstructure:"input"`

	// Whether the tool use resulted in an error.
	//
	// If true, the content typically describes the error that occurred.
	// Default: false
	IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"`

	// The MIME type of the image. Different providers may support different image
	// types.
	MimeType string `json:"mimeType" yaml:"mimeType" mapstructure:"mimeType"`

	// The name of the tool to call.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// An optional structured result value.
	//
	// This can be any JSON value (object, array, string, number, boolean, or null).
	// If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that
	// schema.
	StructuredContent interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`

	// The text content of the message.
	Text string `json:"text" yaml:"text" mapstructure:"text"`

	// The ID of the tool use this result corresponds to.
	//
	// This MUST match the ID from a previous {@link ToolUseContent}.
	ToolUseId string `json:"toolUseId" yaml:"toolUseId" mapstructure:"toolUseId"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Text provided to or from an LLM.

func (*CreateMessageResultContent) UnmarshalJSON

func (j *CreateMessageResultContent) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent_0

type CreateMessageResultContent_0 = TextContent

type CreateMessageResultContent_1

type CreateMessageResultContent_1 = ImageContent

type CreateMessageResultContent_2

type CreateMessageResultContent_2 = AudioContent

type CreateMessageResultContent_3 added in v0.15.0

type CreateMessageResultContent_3 = ToolUseContent

type CreateMessageResultContent_4 added in v0.15.0

type CreateMessageResultContent_4 = ToolResultContent

type CreateMessageResultContent_5 added in v0.15.0

type CreateMessageResultContent_5 []SamplingMessageContentBlock

func (*CreateMessageResultContent_5) UnmarshalJSON added in v0.15.0

func (j *CreateMessageResultContent_5) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent_5Elem added in v0.8.0

type CreateMessageResultContent_5Elem interface{}

type CreateTaskResult deprecated added in v0.8.0

type CreateTaskResult = legacy.CreateTaskResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type Cursor

type Cursor string

An opaque token used to represent a cursor for pagination.

type DiscoverRequest added in v0.15.0

type DiscoverRequest 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 RequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

A request from the client asking the server to advertise its supported protocol versions, capabilities, and other metadata. Servers **MUST** implement `server/discover`. Clients **MAY** call it but are not required to — version negotiation can also happen inline via per-request `_meta`.

func (*DiscoverRequest) UnmarshalJSON added in v0.15.0

func (j *DiscoverRequest) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResult added in v0.15.0

type DiscoverResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope DiscoverResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

	// The capabilities of the server.
	Capabilities ServerCapabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"`

	// Natural-language guidance describing the server and its features.
	//
	// This can be used by clients to improve an LLM's understanding of
	// available tools (e.g., by including it in a system prompt). It should
	// focus on information that helps the model use the server effectively
	// and should not duplicate information already in tool descriptions.
	Instructions *string `json:"instructions,omitempty" yaml:"instructions,omitempty" mapstructure:"instructions,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// MCP Protocol Versions this server supports. The client should choose a
	// version from this list for use in subsequent requests.
	SupportedVersions []string `json:"supportedVersions" yaml:"supportedVersions" mapstructure:"supportedVersions"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link DiscoverRequestserver/discover} request.

func (*DiscoverResult) UnmarshalJSON added in v0.15.0

func (j *DiscoverResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResultCacheScope added in v0.15.0

type DiscoverResultCacheScope string
const DiscoverResultCacheScopePrivate DiscoverResultCacheScope = "private"
const DiscoverResultCacheScopePublic DiscoverResultCacheScope = "public"

func (*DiscoverResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *DiscoverResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResultResponse added in v0.15.0

type DiscoverResultResponse 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 DiscoverResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link DiscoverRequestserver/discover} request.

func (*DiscoverResultResponse) UnmarshalJSON added in v0.15.0

func (j *DiscoverResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequest added in v0.3.6

type ElicitRequest struct {
	// Id and Jsonrpc preserve the pre-July root API. July transports may carry
	// these in their JSON-RPC envelope.
	Id      RequestId `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`
	Jsonrpc string    `json:"jsonrpc,omitempty" yaml:"jsonrpc,omitempty" mapstructure:"jsonrpc,omitempty"`

	// 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 ElicitRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

A request from the server to elicit additional information from the user via the client.

func (*ElicitRequest) UnmarshalJSON added in v0.3.6

func (j *ElicitRequest) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestElicitRequestParams added in v0.9.0

type ElicitRequestElicitRequestParams interface{}

type ElicitRequestFormParams added in v0.8.0

type ElicitRequestFormParams struct {
	// The message to present to the user describing what information is being
	// requested.
	Message string `json:"message" yaml:"message" mapstructure:"message"`

	// The elicitation mode.
	Mode *string `json:"mode,omitempty" yaml:"mode,omitempty" mapstructure:"mode,omitempty"`

	// A restricted subset of JSON Schema.
	// Only top-level properties are allowed, without nesting.
	RequestedSchema ElicitRequestFormParamsRequestedSchema `json:"requestedSchema" yaml:"requestedSchema" mapstructure:"requestedSchema"`
}

The parameters for a request to elicit non-sensitive information from the user via a form in the client.

func (*ElicitRequestFormParams) UnmarshalJSON added in v0.8.0

func (j *ElicitRequestFormParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestFormParamsMeta deprecated added in v0.8.0

type ElicitRequestFormParamsMeta = legacy.ElicitRequestFormParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ElicitRequestFormParamsRequestedSchema added in v0.8.0

type ElicitRequestFormParamsRequestedSchema struct {
	// Schema corresponds to the JSON schema field "$schema".
	Schema *string `json:"$schema,omitempty" yaml:"$schema,omitempty" mapstructure:"$schema,omitempty"`

	// Properties corresponds to the JSON schema field "properties".
	Properties map[string]interface{} `json:"properties" yaml:"properties" mapstructure:"properties"`

	// 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 restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.

func (*ElicitRequestFormParamsRequestedSchema) UnmarshalJSON added in v0.8.0

func (j *ElicitRequestFormParamsRequestedSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParams added in v0.3.6

type ElicitRequestParams struct {
	Meta            *URLElicitRequestParamsMeta        `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
	ElicitationId   string                             `json:"elicitationId,omitempty" yaml:"elicitationId,omitempty" mapstructure:"elicitationId,omitempty"`
	Message         string                             `json:"message" yaml:"message" mapstructure:"message"`
	Mode            ElicitRequestParamsMode            `json:"mode,omitempty" yaml:"mode,omitempty" mapstructure:"mode,omitempty"`
	RequestedSchema ElicitRequestParamsRequestedSchema `json:"requestedSchema,omitempty" yaml:"requestedSchema,omitempty" mapstructure:"requestedSchema,omitempty"`
	Url             string                             `json:"url,omitempty" yaml:"url,omitempty" mapstructure:"url,omitempty"`
}

ElicitRequestParams is the legacy superset retained by the root API. It can represent both July form and URL modes; the versioned July package exposes the strict union generated from the schema.

type ElicitRequestParamsMode added in v0.5.5

type ElicitRequestParamsMode string

type ElicitRequestParamsRequestedSchema added in v0.3.6

type ElicitRequestParamsRequestedSchema = ElicitRequestFormParamsRequestedSchema

type ElicitRequestParamsUnion added in v0.15.0

type ElicitRequestParamsUnion interface{}

type ElicitRequestParams_1 added in v0.15.0

type ElicitRequestParams_1 interface{}

The parameters for a request to elicit additional information from the user via the client.

type ElicitRequestURLParams added in v0.8.0

type ElicitRequestURLParams struct {
	// The message to present to the user explaining why the interaction is needed.
	Message string `json:"message" yaml:"message" mapstructure:"message"`

	// The elicitation mode.
	Mode string `json:"mode" yaml:"mode" mapstructure:"mode"`

	// The URL that the user should navigate to.
	Url string `json:"url" yaml:"url" mapstructure:"url"`
}

The parameters for a request to elicit information from the user via a URL in the client.

func (*ElicitRequestURLParams) UnmarshalJSON added in v0.8.0

func (j *ElicitRequestURLParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestURLParamsMeta deprecated added in v0.8.0

type ElicitRequestURLParamsMeta = legacy.ElicitRequestURLParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ElicitResult added in v0.3.6

type ElicitResult struct {
	// The user action in response to the elicitation.
	// - `"accept"`: User submitted the form/confirmed the action
	// - `"decline"`: User explicitly declined the action
	// - `"cancel"`: User dismissed without making an explicit choice
	Action ElicitResultAction `json:"action" yaml:"action" mapstructure:"action"`

	// The submitted form data, only present when action is `"accept"` and mode was
	// `"form"`.
	// Contains values matching the requested schema.
	// Omitted for out-of-band mode responses.
	Content map[string]interface{} `json:"content,omitempty" yaml:"content,omitempty" mapstructure:"content,omitempty"`
}

The result returned by the client for an {@link ElicitRequestelicitation/create} request.

func (*ElicitResult) UnmarshalJSON added in v0.3.6

func (j *ElicitResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitResultAction added in v0.3.6

type ElicitResultAction string
const ElicitResultActionAccept ElicitResultAction = "accept"
const ElicitResultActionCancel ElicitResultAction = "cancel"
const ElicitResultActionDecline ElicitResultAction = "decline"

func (*ElicitResultAction) UnmarshalJSON added in v0.3.6

func (j *ElicitResultAction) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ElicitationCompleteNotification deprecated added in v0.8.0

type ElicitationCompleteNotification = legacy.ElicitationCompleteNotification

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ElicitationCompleteNotificationParams deprecated added in v0.8.0

type ElicitationCompleteNotificationParams = legacy.ElicitationCompleteNotificationParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type EmbeddedResource

type EmbeddedResource struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"`

	// Resource corresponds to the JSON schema field "resource".
	Resource EmbeddedResourceResource `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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResourceResource

type EmbeddedResourceResource struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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 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 (*EmbeddedResourceResource) UnmarshalJSON

func (j *EmbeddedResourceResource) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResourceResource_0

type EmbeddedResourceResource_0 = TextResourceContents

type EmbeddedResourceResource_1

type EmbeddedResourceResource_1 = BlobResourceContents

type EmptyResult

type EmptyResult struct{}

type EnumSchema added in v0.5.0

type EnumSchema interface{}

type Error

type Error 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 (*Error) UnmarshalJSON added in v0.8.0

func (j *Error) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequest

type GetPromptRequest 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 GetPromptRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Used by the client to get a prompt provided by the server.

func (*GetPromptRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParams

type GetPromptRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// Arguments to use for templating the prompt.
	Arguments map[string]string `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"`

	// InputResponses corresponds to the JSON schema field "inputResponses".
	InputResponses map[string]interface{} `json:"inputResponses,omitempty" yaml:"inputResponses,omitempty" mapstructure:"inputResponses,omitempty"`

	// The name of the prompt or prompt template.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`
}

Parameters for a `prompts/get` request.

func (*GetPromptRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParamsMeta deprecated added in v0.8.0

type GetPromptRequestParamsMeta = legacy.GetPromptRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetPromptResult

type GetPromptResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `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"`

	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`
	RequestState  *string                `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Messages corresponds to the JSON schema field "messages".
	Messages []PromptMessage `json:"messages" yaml:"messages" mapstructure:"messages"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

The result returned by the server for a {@link GetPromptRequestprompts/get} request.

func (*GetPromptResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultResponse added in v0.15.0

type GetPromptResultResponse 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 GetPromptResultResponseResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link GetPromptRequestprompts/get} request.

func (*GetPromptResultResponse) UnmarshalJSON added in v0.15.0

func (j *GetPromptResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultResponseResult added in v0.15.0

type GetPromptResultResponseResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `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"`

	// InputRequests corresponds to the JSON schema field "inputRequests".
	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`

	// Messages corresponds to the JSON schema field "messages".
	Messages []PromptMessage `json:"messages" yaml:"messages" mapstructure:"messages"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.

At least one of `inputRequests` or `requestState` MUST be present.

func (*GetPromptResultResponseResult) UnmarshalJSON added in v0.15.0

func (j *GetPromptResultResponseResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultResponseResult_0 added in v0.15.0

type GetPromptResultResponseResult_0 = InputRequiredResult

type GetPromptResultResponseResult_1 added in v0.15.0

type GetPromptResultResponseResult_1 = GetPromptResult

type GetTaskPayloadRequest deprecated added in v0.8.0

type GetTaskPayloadRequest = legacy.GetTaskPayloadRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetTaskPayloadRequestParams deprecated added in v0.8.0

type GetTaskPayloadRequestParams = legacy.GetTaskPayloadRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetTaskPayloadResult deprecated added in v0.8.0

type GetTaskPayloadResult = legacy.GetTaskPayloadResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetTaskRequest deprecated added in v0.8.0

type GetTaskRequest = legacy.GetTaskRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetTaskRequestParams deprecated added in v0.8.0

type GetTaskRequestParams = legacy.GetTaskRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type GetTaskResult deprecated added in v0.8.0

type GetTaskResult = legacy.GetTaskResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type HeaderMismatchError added in v0.15.0

type HeaderMismatchError struct {
	// Error corresponds to the JSON schema field "error".
	Error HeaderMismatchErrorError `json:"error" yaml:"error" mapstructure:"error"`

	// Id corresponds to the JSON schema field "id".
	Id *RequestId `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`

	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`
}

Returned when a server rejects a request because the values in the HTTP headers do not match the corresponding values in the request body, or because required headers are missing or malformed. For HTTP, the response status code MUST be `400 Bad Request`.

func (*HeaderMismatchError) UnmarshalJSON added in v0.15.0

func (j *HeaderMismatchError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type HeaderMismatchErrorError added in v0.15.0

type HeaderMismatchErrorError 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 (*HeaderMismatchErrorError) UnmarshalJSON added in v0.15.0

func (j *HeaderMismatchErrorError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Icon added in v0.8.0

type Icon struct {
	// Optional MIME type override if the source MIME type is missing or generic.
	// For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`.
	MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"`

	// Optional array of strings that specify sizes at which the icon can be used.
	// Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for
	// scalable formats like SVG.
	//
	// If not provided, the client should assume that the icon can be used at any
	// size.
	Sizes []string `json:"sizes,omitempty" yaml:"sizes,omitempty" mapstructure:"sizes,omitempty"`

	// A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
	// `data:` URI with Base64-encoded image data.
	//
	// Consumers SHOULD take steps to ensure URLs serving icons are from the
	// same domain as the client/server or a trusted domain.
	//
	// Consumers SHOULD take appropriate precautions when consuming SVGs as they can
	// contain
	// executable JavaScript.
	Src string `json:"src" yaml:"src" mapstructure:"src"`

	// Optional specifier for the theme this icon is designed for. `"light"` indicates
	// the icon is designed to be used with a light background, and `"dark"` indicates
	// the icon is designed to be used with a dark background.
	//
	// If not provided, the client should assume the icon can be used with any theme.
	Theme *IconTheme `json:"theme,omitempty" yaml:"theme,omitempty" mapstructure:"theme,omitempty"`
}

An optionally-sized icon that can be displayed in a user interface.

func (*Icon) UnmarshalJSON added in v0.8.0

func (j *Icon) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IconTheme added in v0.8.0

type IconTheme string
const IconThemeDark IconTheme = "dark"
const IconThemeLight IconTheme = "light"

func (*IconTheme) UnmarshalJSON added in v0.8.0

func (j *IconTheme) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Icons added in v0.8.0

type Icons struct {
	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`
}

Base interface to add `icons` property.

type ImageContent

type ImageContent struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Implementation

type Implementation struct {
	// An optional human-readable description of what this implementation does.
	//
	// This can be used by clients or servers to provide context about their purpose
	// and capabilities. For example, a server might describe the types of resources
	// or tools it provides, while a client might describe its intended use case.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// The version of this implementation.
	Version string `json:"version" yaml:"version" mapstructure:"version"`

	// An optional URL of the website for this implementation.
	WebsiteUrl *string `json:"websiteUrl,omitempty" yaml:"websiteUrl,omitempty" mapstructure:"websiteUrl,omitempty"`
}

Describes the MCP implementation.

func NewImplementation

func NewImplementation(name, version string) *Implementation

NewImplementation preserves the constructor exposed by the previous root schema while returning the July Implementation type.

func (*Implementation) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequest

type InitializeRequest struct {
	Id      RequestId               `json:"id" yaml:"id" mapstructure:"id"`
	Jsonrpc string                  `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`
	Method  string                  `json:"method" yaml:"method" mapstructure:"method"`
	Params  InitializeRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

InitializeRequest and related models remain available for negotiated legacy sessions. Their capability fields use the July-preferred root models so existing root-package callers remain source compatible.

type InitializeRequestParams

type InitializeRequestParams struct {
	Meta            *InitializeRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
	Capabilities    ClientCapabilities           `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"`
	ClientInfo      Implementation               `json:"clientInfo" yaml:"clientInfo" mapstructure:"clientInfo"`
	ProtocolVersion string                       `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"`
}

type InitializeRequestParamsMeta deprecated added in v0.8.0

type InitializeRequestParamsMeta = legacy.InitializeRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type InitializeResult

type InitializeResult struct {
	Meta            map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
	Capabilities    ServerCapabilities     `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"`
	Instructions    *string                `json:"instructions,omitempty" yaml:"instructions,omitempty" mapstructure:"instructions,omitempty"`
	ProtocolVersion string                 `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"`
	ServerInfo      Implementation         `json:"serverInfo" yaml:"serverInfo" mapstructure:"serverInfo"`
}

type InitializedNotification deprecated

type InitializedNotification = legacy.InitializedNotification

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type InputRequest added in v0.15.0

type InputRequest interface{}

type InputRequiredResult added in v0.15.0

type InputRequiredResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// InputRequests corresponds to the JSON schema field "inputRequests".
	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.

At least one of `inputRequests` or `requestState` MUST be present.

func (*InputRequiredResult) UnmarshalJSON added in v0.15.0

func (j *InputRequiredResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InputResponse added in v0.15.0

type InputResponse interface{}

type InputResponseRequestParams added in v0.15.0

type InputResponseRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// InputResponses corresponds to the JSON schema field "inputResponses".
	InputResponses map[string]interface{} `json:"inputResponses,omitempty" yaml:"inputResponses,omitempty" mapstructure:"inputResponses,omitempty"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`
}

func (*InputResponseRequestParams) UnmarshalJSON added in v0.15.0

func (j *InputResponseRequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InternalError added in v0.15.0

type InternalError 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"`
}

A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.

func (*InternalError) UnmarshalJSON added in v0.15.0

func (j *InternalError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InvalidParamsError added in v0.15.0

type InvalidParamsError 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"`
}

A JSON-RPC error indicating that the method parameters are invalid or malformed.

In MCP, this error is returned in various contexts when request parameters fail validation:

- **Tools**: Unknown tool name or invalid tool arguments - **Prompts**: Unknown prompt name or missing required arguments - **Pagination**: Invalid or expired cursor values - **Logging**: Invalid log level - **Elicitation**: Server requests an elicitation mode not declared in client capabilities - **Sampling**: Missing tool result or tool results mixed with other content

func (*InvalidParamsError) UnmarshalJSON added in v0.15.0

func (j *InvalidParamsError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InvalidRequestError added in v0.15.0

type InvalidRequestError 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"`
}

A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like `jsonrpc` or `method`, or using invalid types for these fields).

func (*InvalidRequestError) UnmarshalJSON added in v0.15.0

func (j *InvalidRequestError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONArray added in v0.15.0

type JSONArray []interface{}

type JSONRPCErrorResponse added in v0.8.0

type JSONRPCErrorResponse struct {
	// Error corresponds to the JSON schema field "error".
	Error Error `json:"error" yaml:"error" mapstructure:"error"`

	// Id corresponds to the JSON schema field "id".
	Id *RequestId `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`

	// 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 (*JSONRPCErrorResponse) UnmarshalJSON added in v0.8.0

func (j *JSONRPCErrorResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCMessage

type JSONRPCMessage interface{}

Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.

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 map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

A notification which does not expect a response.

func (*JSONRPCNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

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 map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

A request that expects a response.

func (*JSONRPCRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCResponse

type JSONRPCResponse interface{}

A response to a request, containing either the result or error.

type JSONRPCResultResponse added in v0.8.0

type JSONRPCResultResponse 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 (*JSONRPCResultResponse) UnmarshalJSON added in v0.8.0

func (j *JSONRPCResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type JSONValue added in v0.15.0

type JSONValue interface{}

type LegacyTitledEnumSchema added in v0.8.0

type LegacyTitledEnumSchema struct {
	// Default corresponds to the JSON schema field "default".
	Default *string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Description corresponds to the JSON schema field "description".
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Enum corresponds to the JSON schema field "enum".
	Enum []string `json:"enum" yaml:"enum" mapstructure:"enum"`

	// (Legacy) Display names for enum values.
	// Non-standard according to JSON schema 2020-12.
	EnumNames []string `json:"enumNames,omitempty" yaml:"enumNames,omitempty" mapstructure:"enumNames,omitempty"`

	// Title corresponds to the JSON schema field "title".
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Use {@link TitledSingleSelectEnumSchema} instead. This interface will be removed in a future version.

func (*LegacyTitledEnumSchema) UnmarshalJSON added in v0.8.0

func (j *LegacyTitledEnumSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequest

type ListPromptsRequest 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 PaginatedRequestParams `json:"params" yaml:"params" mapstructure:"params"`

	// PaginatedRequestParams preserves the pre-July Go field name. Params is the
	// canonical July field and both are synchronized while decoding.
	PaginatedRequestParams *PaginatedRequestParams `json:"-" yaml:"-" mapstructure:"-"`
}

Sent from the client to request a list of prompts and prompt templates the server has.

func (*ListPromptsRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequestParams

type ListPromptsRequestParams = PaginatedRequestParams

type ListPromptsResult

type ListPromptsResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ListPromptsResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

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

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link ListPromptsRequestprompts/list} request.

func (*ListPromptsResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsResultCacheScope added in v0.15.0

type ListPromptsResultCacheScope string
const ListPromptsResultCacheScopePrivate ListPromptsResultCacheScope = "private"
const ListPromptsResultCacheScopePublic ListPromptsResultCacheScope = "public"

func (*ListPromptsResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *ListPromptsResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsResultResponse added in v0.15.0

type ListPromptsResultResponse 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 ListPromptsResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link ListPromptsRequestprompts/list} request.

func (*ListPromptsResultResponse) UnmarshalJSON added in v0.15.0

func (j *ListPromptsResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesRequest

type ListResourceTemplatesRequest 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 PaginatedRequestParams `json:"params" yaml:"params" mapstructure:"params"`

	// PaginatedRequestParams preserves the pre-July Go field name. Params is the
	// canonical July field and both are synchronized while decoding.
	PaginatedRequestParams *PaginatedRequestParams `json:"-" yaml:"-" mapstructure:"-"`
}

Sent from the client to request a list of resource templates the server has.

func (*ListResourceTemplatesRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesRequestParams

type ListResourceTemplatesRequestParams = PaginatedRequestParams

type ListResourceTemplatesResult

type ListResourceTemplatesResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ListResourceTemplatesResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

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

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.

func (*ListResourceTemplatesResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesResultCacheScope added in v0.15.0

type ListResourceTemplatesResultCacheScope string
const ListResourceTemplatesResultCacheScopePrivate ListResourceTemplatesResultCacheScope = "private"
const ListResourceTemplatesResultCacheScopePublic ListResourceTemplatesResultCacheScope = "public"

func (*ListResourceTemplatesResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *ListResourceTemplatesResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesResultResponse added in v0.15.0

type ListResourceTemplatesResultResponse 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 ListResourceTemplatesResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.

func (*ListResourceTemplatesResultResponse) UnmarshalJSON added in v0.15.0

func (j *ListResourceTemplatesResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesRequest

type ListResourcesRequest 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 PaginatedRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Sent from the client to request a list of resources the server has.

func (*ListResourcesRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesRequestParams

type ListResourcesRequestParams = PaginatedRequestParams

type ListResourcesResult

type ListResourcesResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ListResourcesResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

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

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link ListResourcesRequestresources/list} request.

func (*ListResourcesResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesResultCacheScope added in v0.15.0

type ListResourcesResultCacheScope string
const ListResourcesResultCacheScopePrivate ListResourcesResultCacheScope = "private"
const ListResourcesResultCacheScopePublic ListResourcesResultCacheScope = "public"

func (*ListResourcesResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *ListResourcesResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesResultResponse added in v0.15.0

type ListResourcesResultResponse 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 ListResourcesResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link ListResourcesRequestresources/list} request.

func (*ListResourcesResultResponse) UnmarshalJSON added in v0.15.0

func (j *ListResourcesResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

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) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListRootsRequestParams

type ListRootsRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
}

type ListRootsResult

type ListRootsResult struct {
	// Roots corresponds to the JSON schema field "roots".
	Roots []Root `json:"roots" yaml:"roots" mapstructure:"roots"`
}

The result returned by the client for a {@link ListRootsRequestroots/list} request. This result contains an array of {@link Root} objects, each representing a root directory or file that the server can operate on.

func (*ListRootsResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListTasksRequest deprecated added in v0.8.0

type ListTasksRequest = legacy.ListTasksRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ListTasksResult deprecated added in v0.8.0

type ListTasksResult = legacy.ListTasksResult

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ListToolsRequest

type ListToolsRequest 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 PaginatedRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Sent from the client to request a list of tools the server has.

func (*ListToolsRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListToolsRequestParams

type ListToolsRequestParams = PaginatedRequestParams

type ListToolsResult

type ListToolsResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ListToolsResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

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

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// Tools corresponds to the JSON schema field "tools".
	Tools []Tool `json:"tools" yaml:"tools" mapstructure:"tools"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link ListToolsRequesttools/list} request.

func (*ListToolsResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListToolsResultCacheScope added in v0.15.0

type ListToolsResultCacheScope string
const ListToolsResultCacheScopePrivate ListToolsResultCacheScope = "private"
const ListToolsResultCacheScopePublic ListToolsResultCacheScope = "public"

func (*ListToolsResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *ListToolsResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ListToolsResultResponse added in v0.15.0

type ListToolsResultResponse 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 ListToolsResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link ListToolsRequesttools/list} request.

func (*ListToolsResultResponse) UnmarshalJSON added in v0.15.0

func (j *ListToolsResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LoggingLevel

type LoggingLevel string
const (
	Debug     LoggingLevel = "debug"
	Info      LoggingLevel = "info"
	Notice    LoggingLevel = "notice"
	Warning   LoggingLevel = "warning"
	Err       LoggingLevel = "error"
	Critical  LoggingLevel = "critical"
	Alert     LoggingLevel = "alert"
	Emergency LoggingLevel = "emergency"
)
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) Ordinal

func (d LoggingLevel) Ordinal() int

Ordinal ordinal means more verbose (i.e., more information)

func (*LoggingLevel) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotification

type LoggingMessageNotification 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 LoggingMessageNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

JSONRPCNotification of a log message passed from server to client. The client opts in by setting `"io.modelcontextprotocol/logLevel"` in a request's `_meta`.

func (*LoggingMessageNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotificationParams

type LoggingMessageNotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

Parameters for a `notifications/message` notification.

func (*LoggingMessageNotificationParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type MethodNotFoundError added in v0.15.0

type MethodNotFoundError 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"`
}

A JSON-RPC error indicating that the requested method does not exist or is not available.

In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling `prompts/list` when the `prompts` capability was not advertised).

A request that requires a client capability the client did not declare is signalled instead by {@link MissingRequiredClientCapabilityError} (`-32021`).

func (*MethodNotFoundError) UnmarshalJSON added in v0.15.0

func (j *MethodNotFoundError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityError added in v0.15.0

type MissingRequiredClientCapabilityError struct {
	// Error corresponds to the JSON schema field "error".
	Error MissingRequiredClientCapabilityErrorError `json:"error" yaml:"error" mapstructure:"error"`

	// Id corresponds to the JSON schema field "id".
	Id *RequestId `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`

	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`
}

Returned when processing a request requires a capability the client did not declare in `clientCapabilities`. For HTTP, the response status code MUST be `400 Bad Request`.

func (*MissingRequiredClientCapabilityError) UnmarshalJSON added in v0.15.0

func (j *MissingRequiredClientCapabilityError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityErrorError added in v0.15.0

type MissingRequiredClientCapabilityErrorError 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 MissingRequiredClientCapabilityErrorErrorData `json:"data" yaml:"data" mapstructure:"data"`

	// 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 (*MissingRequiredClientCapabilityErrorError) UnmarshalJSON added in v0.15.0

func (j *MissingRequiredClientCapabilityErrorError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityErrorErrorData added in v0.15.0

type MissingRequiredClientCapabilityErrorErrorData struct {
	// The capabilities the server requires from the client to process this request.
	RequiredCapabilities ClientCapabilities `json:"requiredCapabilities" yaml:"requiredCapabilities" mapstructure:"requiredCapabilities"`
}

Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).

func (*MissingRequiredClientCapabilityErrorErrorData) UnmarshalJSON added in v0.15.0

func (j *MissingRequiredClientCapabilityErrorErrorData) UnmarshalJSON(value []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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type MultiSelectEnumSchema added in v0.8.0

type MultiSelectEnumSchema interface{}

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 map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

func (*Notification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type NotificationMetaObject added in v0.15.0

type NotificationMetaObject struct {
	// Identifies the subscription stream a notification was delivered on. The
	// server MUST include this key on every notification delivered via a
	// {@link SubscriptionsListenRequestsubscriptions/listen} stream, so the
	// client can correlate the notification with the originating subscription.
	// The key is absent on notifications not delivered via a subscription
	// stream (e.g. progress notifications for an in-flight request), which is
	// why it is optional here.
	//
	// The value is the JSON-RPC ID of the `subscriptions/listen` request that
	// opened the stream.
	IoModelcontextprotocolSubscriptionId *RequestId `` /* 175-byte string literal not displayed */
}

Extends {@link MetaObject} with additional notification-specific fields. All key naming rules from `MetaObject` apply.

type NotificationParams

type NotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
}

Common params for any notification.

type NumberSchema added in v0.5.0

type NumberSchema struct {
	// Default corresponds to the JSON schema field "default".
	Default *float64 `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Description corresponds to the JSON schema field "description".
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Maximum corresponds to the JSON schema field "maximum".
	Maximum *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty" mapstructure:"maximum,omitempty"`

	// Minimum corresponds to the JSON schema field "minimum".
	Minimum *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty" mapstructure:"minimum,omitempty"`

	// Title corresponds to the JSON schema field "title".
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type NumberSchemaType `json:"type" yaml:"type" mapstructure:"type"`
}

func (*NumberSchema) UnmarshalJSON added in v0.5.0

func (j *NumberSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type NumberSchemaType added in v0.5.0

type NumberSchemaType string
const NumberSchemaTypeInteger NumberSchemaType = "integer"
const NumberSchemaTypeNumber NumberSchemaType = "number"

func (*NumberSchemaType) UnmarshalJSON added in v0.5.0

func (j *NumberSchemaType) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequest

type PaginatedRequest 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 PaginatedRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

func (*PaginatedRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequestParams

type PaginatedRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

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

Common params for paginated requests.

func (*PaginatedRequestParams) UnmarshalJSON added in v0.15.0

func (j *PaginatedRequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequestParamsMeta deprecated added in v0.8.0

type PaginatedRequestParamsMeta = legacy.PaginatedRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type PaginatedResult

type PaginatedResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `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"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

func (*PaginatedResult) UnmarshalJSON added in v0.15.0

func (j *PaginatedResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ParseError added in v0.15.0

type ParseError 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"`
}

A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.

func (*ParseError) UnmarshalJSON added in v0.15.0

func (j *ParseError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PingRequest deprecated

type PingRequest = legacy.PingRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type PingRequestParams

type PingRequestParams = RequestParams

type PingResult

type PingResult EmptyResult

type PrimitiveSchemaDefinition added in v0.5.0

type PrimitiveSchemaDefinition interface{}

Restricted schema definitions that only allow primitive types without nested objects or arrays.

type ProgressNotification

type ProgressNotification 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 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

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

UnmarshalJSON implements json.Unmarshaler.

type ProgressNotificationParams

type ProgressNotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An optional message describing the current progress.
	Message *string `json:"message,omitempty" yaml:"message,omitempty" mapstructure:"message,omitempty"`

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

Parameters for a {@link ProgressNotificationnotifications/progress} notification.

func (*ProgressNotificationParams) UnmarshalJSON

func (j *ProgressNotificationParams) UnmarshalJSON(value []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 {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`
}

A prompt or prompt template that the server offers.

func (*Prompt) UnmarshalJSON

func (j *Prompt) UnmarshalJSON(value []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"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	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"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`
}

Describes an argument that a prompt can accept.

func (*PromptArgument) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PromptListChangedNotification

type PromptListChangedNotification 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 *NotificationParams `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 is only delivered on a {@link SubscriptionsListenRequestsubscriptions/listen} stream when the client requested it via the `promptsListChanged` filter field.

func (*PromptListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PromptMessage

type PromptMessage struct {
	// Content corresponds to the JSON schema field "content".
	Content PromptMessageContent `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 {@link SamplingMessage}, but also supports the embedding of resources from the MCP server.

func (*PromptMessage) UnmarshalJSON

func (j *PromptMessage) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PromptMessageContent

type PromptMessageContent interface{}

type PromptReference

type PromptReference struct {
	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequest

type ReadResourceRequest 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 ReadResourceRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Sent from the client to the server, to read a specific resource URI.

func (*ReadResourceRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequestParams

type ReadResourceRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// InputResponses corresponds to the JSON schema field "inputResponses".
	InputResponses map[string]interface{} `json:"inputResponses,omitempty" yaml:"inputResponses,omitempty" mapstructure:"inputResponses,omitempty"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// The URI of the resource. The URI can use any protocol; it is up to the server
	// how to interpret it.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

Parameters for a `resources/read` request.

func (*ReadResourceRequestParams) UnmarshalJSON

func (j *ReadResourceRequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequestParamsMeta deprecated added in v0.8.0

type ReadResourceRequestParamsMeta = legacy.ReadResourceRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ReadResourceResult

type ReadResourceResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ReadResourceResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

	// Contents corresponds to the JSON schema field "contents".
	Contents []ReadResourceResultContentsElem `json:"contents" yaml:"contents" mapstructure:"contents"`

	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`
	RequestState  *string                `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

The result returned by the server for a {@link ReadResourceRequestresources/read} request.

func (*ReadResourceResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultCacheScope added in v0.15.0

type ReadResourceResultCacheScope string
const ReadResourceResultCacheScopePrivate ReadResourceResultCacheScope = "private"
const ReadResourceResultCacheScopePublic ReadResourceResultCacheScope = "public"

func (*ReadResourceResultCacheScope) UnmarshalJSON added in v0.15.0

func (j *ReadResourceResultCacheScope) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultContentsElem

type ReadResourceResultContentsElem struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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 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 (*ReadResourceResultContentsElem) UnmarshalJSON

func (j *ReadResourceResultContentsElem) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultContentsElem_0

type ReadResourceResultContentsElem_0 = TextResourceContents

type ReadResourceResultContentsElem_1

type ReadResourceResultContentsElem_1 = BlobResourceContents

type ReadResourceResultResponse added in v0.15.0

type ReadResourceResultResponse 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 ReadResourceResultResponseResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link ReadResourceRequestresources/read} request.

func (*ReadResourceResultResponse) UnmarshalJSON added in v0.15.0

func (j *ReadResourceResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResult added in v0.15.0

type ReadResourceResultResponseResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the intended scope of the cached response, analogous to HTTP
	// `Cache-Control: public` vs `Cache-Control: private`.
	//
	// - `"public"`: The response does not contain user-specific data. Any
	//   client or intermediary (e.g., shared gateway, caching proxy) MAY cache
	//   the response and serve it across authorization contexts.
	// - `"private"`: The response MAY be cached and reused only within the
	//   same authorization context. Caches MUST NOT be shared across
	//   authorization contexts (e.g., a different access token requires a
	//   different cache).
	CacheScope ReadResourceResultCacheScope `json:"cacheScope" yaml:"cacheScope" mapstructure:"cacheScope"`

	// Contents corresponds to the JSON schema field "contents".
	Contents []ReadResourceResultResponseResultContentsElem `json:"contents" yaml:"contents" mapstructure:"contents"`

	// InputRequests corresponds to the JSON schema field "inputRequests".
	InputRequests map[string]interface{} `json:"inputRequests,omitempty" yaml:"inputRequests,omitempty" mapstructure:"inputRequests,omitempty"`

	// RequestState corresponds to the JSON schema field "requestState".
	RequestState *string `json:"requestState,omitempty" yaml:"requestState,omitempty" mapstructure:"requestState,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	// A hint from the server indicating how long (in milliseconds) the
	// client MAY cache this response before re-fetching. Semantics are
	// analogous to HTTP Cache-Control max-age.
	//
	// - If 0, The response SHOULD be considered immediately stale,
	//   The client MAY re-fetch every time the result is needed.
	// - If positive, the client SHOULD consider the result fresh for this many
	//   milliseconds after receiving the response.
	TtlMs int `json:"ttlMs" yaml:"ttlMs" mapstructure:"ttlMs"`
}

An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.

At least one of `inputRequests` or `requestState` MUST be present.

func (*ReadResourceResultResponseResult) UnmarshalJSON added in v0.15.0

func (j *ReadResourceResultResponseResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResultContentsElem added in v0.15.0

type ReadResourceResultResponseResultContentsElem struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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 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 (*ReadResourceResultResponseResultContentsElem) UnmarshalJSON added in v0.15.0

func (j *ReadResourceResultResponseResultContentsElem) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResultContentsElem_0 added in v0.15.0

type ReadResourceResultResponseResultContentsElem_0 = TextResourceContents

type ReadResourceResultResponseResultContentsElem_1 added in v0.15.0

type ReadResourceResultResponseResultContentsElem_1 = BlobResourceContents

type ReadResourceResultResponseResult_0 added in v0.15.0

type ReadResourceResultResponseResult_0 = InputRequiredResult

type ReadResourceResultResponseResult_1 added in v0.15.0

type ReadResourceResultResponseResult_1 = ReadResourceResult

type RelatedTaskMetadata deprecated added in v0.8.0

type RelatedTaskMetadata = legacy.RelatedTaskMetadata

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

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 map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

func (*Request) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type RequestId

type RequestId int

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

type RequestMetaObject added in v0.15.0

type RequestMetaObject struct {
	// The client's capabilities for this specific request. Required.
	//
	// Capabilities are declared per-request rather than once at initialization;
	// an empty object means the client supports no optional capabilities.
	// Servers MUST NOT infer capabilities from prior requests.
	IoModelcontextprotocolClientCapabilities ClientCapabilities `` /* 157-byte string literal not displayed */

	// Identifies the client software making the request. Clients SHOULD
	// include this field on every request unless specifically configured not
	// to do so.
	//
	// The {@link Implementation} schema requires `name` and `version`; other
	// fields are optional.
	//
	// The value is self-reported by the client and is not verified by the
	// protocol. It is intended for display, logging, and debugging. Servers
	// SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for
	// security decisions.
	IoModelcontextprotocolClientInfo *Implementation `` /* 163-byte string literal not displayed */

	// The desired log level for this request. Optional.
	//
	// If absent, the server MUST NOT send any {@link
	// LoggingMessageNotificationnotifications/message}
	// notifications for this request. The client opts in to log messages by
	// explicitly setting a level. Replaces the former `logging/setLevel` RPC.
	IoModelcontextprotocolLogLevel *LoggingLevel `` /* 157-byte string literal not displayed */

	// The MCP Protocol Version being used for this request. Required.
	//
	// For the HTTP transport, this value MUST match the `MCP-Protocol-Version`
	// header; otherwise the server MUST return a `400 Bad Request`. If the
	// server does not support the requested version, it MUST return an
	// {@link UnsupportedProtocolVersionError}.
	IoModelcontextprotocolProtocolVersion string `` /* 148-byte string literal not displayed */

	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by {@link
	// ProgressNotificationnotifications/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"`
}

Extends {@link MetaObject} with additional request-specific fields. All key naming rules from `MetaObject` apply.

func (*RequestMetaObject) UnmarshalJSON added in v0.15.0

func (j *RequestMetaObject) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RequestParams

type RequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`
}

Common params for any request.

func (*RequestParams) UnmarshalJSON added in v0.15.0

func (j *RequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RequestParamsMeta deprecated

type RequestParamsMeta = legacy.RequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type Resource

type Resource struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `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"`

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`

	// The MIME type of this resource, if known.
	MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The size of the raw resource content, in bytes (i.e., before base64 encoding or
	// any tokenization), if known.
	//
	// This can be used by Hosts to display file sizes and estimate context window
	// usage.
	Size *int `json:"size,omitempty" yaml:"size,omitempty" mapstructure:"size,omitempty"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// 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

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceContents

type ResourceContents struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceLink struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `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"`

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`

	// The MIME type of this resource, if known.
	MimeType *string `json:"mimeType,omitempty" yaml:"mimeType,omitempty" mapstructure:"mimeType,omitempty"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The size of the raw resource content, in bytes (i.e., before base64 encoding or
	// any tokenization), if known.
	//
	// This can be used by Hosts to display file sizes and estimate context window
	// usage.
	Size *int `json:"size,omitempty" yaml:"size,omitempty" mapstructure:"size,omitempty"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`

	// The URI of this resource.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

A resource that the server is capable of reading, included in a prompt or tool call result.

Note: resource links returned by tools are not guaranteed to appear in the results of {@link ListResourcesRequestresources/list} requests.

func (*ResourceLink) UnmarshalJSON added in v0.5.0

func (j *ResourceLink) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotification

type ResourceListChangedNotification 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 *NotificationParams `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 is only delivered on a {@link SubscriptionsListenRequestsubscriptions/listen} stream when the client requested it via the `resourcesListChanged` filter field.

func (*ResourceListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceRequestParams added in v0.8.0

type ResourceRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// The URI of the resource. The URI can use any protocol; it is up to the server
	// how to interpret it.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

Common params for resource-related requests.

func (*ResourceRequestParams) UnmarshalJSON added in v0.8.0

func (j *ResourceRequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceRequestParamsMeta deprecated added in v0.8.0

type ResourceRequestParamsMeta = legacy.ResourceRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ResourceTemplate

type ResourceTemplate struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `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"`

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,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"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceTemplateReference added in v0.5.0

type ResourceTemplateReference 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 (*ResourceTemplateReference) UnmarshalJSON added in v0.5.0

func (j *ResourceTemplateReference) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotification

type ResourceUpdatedNotification 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 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 is only sent for resources the client opted in to via the `resourceSubscriptions` field of a {@link SubscriptionsListenRequestsubscriptions/listen} request.

func (*ResourceUpdatedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotificationParams

type ResourceUpdatedNotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

Parameters for a `notifications/resources/updated` notification.

func (*ResourceUpdatedNotificationParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type Result

type Result struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *ResultMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

Common result fields.

func (*Result) UnmarshalJSON added in v0.15.0

func (j *Result) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResultMetaObject added in v0.15.0

type ResultMetaObject struct {
	// Identifies the server software producing the response. Servers SHOULD
	// include this field on every response unless specifically configured not
	// to do so.
	//
	// The {@link Implementation} schema requires `name` and `version`; other
	// fields are optional.
	//
	// The value is self-reported by the server and is not verified by the
	// protocol. It is intended for display, logging, and debugging. Clients
	// SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for
	// security decisions.
	IoModelcontextprotocolServerInfo *Implementation `` /* 163-byte string literal not displayed */
}

Extends {@link MetaObject} with additional result-specific fields. All key naming rules from `MetaObject` apply.

type ResultType added in v0.15.0

type ResultType string

Indicates the type of a {@link Result} object, allowing the client to determine how to parse the response.

complete - the request completed successfully and the result contains the final content. input_required - the request requires additional input and the result contains an {@link InputRequiredResult} object with instructions for the client to provide additional input before retrying the original request.

type Role

type Role string
const RoleAssistant Role = "assistant"
const RoleUser Role = "user"

func (*Role) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type Root

type Root struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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

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

UnmarshalJSON implements json.Unmarshaler.

type RootsListChangedNotification deprecated

type RootsListChangedNotification = legacy.RootsListChangedNotification

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type SamplingMessage

type SamplingMessage struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Content corresponds to the JSON schema field "content".
	Content SamplingMessageContent `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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContent

type SamplingMessageContent struct {
	// Optional metadata about the tool use. Clients SHOULD preserve this field when
	// including tool uses in subsequent sampling requests to enable caching
	// optimizations.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"`

	// The unstructured result content of the tool use.
	//
	// This has the same format as {@link CallToolResult.content} and can include
	// text, images,
	// audio, resource links, and embedded resources.
	Content []ToolResultContentContentElem `json:"content" yaml:"content" mapstructure:"content"`

	// The base64-encoded image data.
	Data string `json:"data" yaml:"data" mapstructure:"data"`

	// A unique identifier for this tool use.
	//
	// This ID is used to match tool results to their corresponding tool uses.
	Id string `json:"id" yaml:"id" mapstructure:"id"`

	// The arguments to pass to the tool, conforming to the tool's input schema.
	Input map[string]interface{} `json:"input" yaml:"input" mapstructure:"input"`

	// Whether the tool use resulted in an error.
	//
	// If true, the content typically describes the error that occurred.
	// Default: false
	IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"`

	// The MIME type of the image. Different providers may support different image
	// types.
	MimeType string `json:"mimeType" yaml:"mimeType" mapstructure:"mimeType"`

	// The name of the tool to call.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// An optional structured result value.
	//
	// This can be any JSON value (object, array, string, number, boolean, or null).
	// If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that
	// schema.
	StructuredContent interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`

	// The text content of the message.
	Text string `json:"text" yaml:"text" mapstructure:"text"`

	// The ID of the tool use this result corresponds to.
	//
	// This MUST match the ID from a previous {@link ToolUseContent}.
	ToolUseId string `json:"toolUseId" yaml:"toolUseId" mapstructure:"toolUseId"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Text provided to or from an LLM.

func (*SamplingMessageContent) UnmarshalJSON

func (j *SamplingMessageContent) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContentBlock added in v0.8.0

type SamplingMessageContentBlock interface{}

type SamplingMessageContent_0

type SamplingMessageContent_0 = TextContent

type SamplingMessageContent_1

type SamplingMessageContent_1 = ImageContent

type SamplingMessageContent_2

type SamplingMessageContent_2 = AudioContent

type SamplingMessageContent_3 added in v0.15.0

type SamplingMessageContent_3 = ToolUseContent

type SamplingMessageContent_4 added in v0.15.0

type SamplingMessageContent_4 = ToolResultContent

type SamplingMessageContent_5 added in v0.15.0

type SamplingMessageContent_5 []SamplingMessageContentBlock

func (*SamplingMessageContent_5) UnmarshalJSON added in v0.15.0

func (j *SamplingMessageContent_5) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContent_5Elem added in v0.8.0

type SamplingMessageContent_5Elem interface{}

type ServerCapabilities

type ServerCapabilities struct {
	// Present if the server supports argument autocompletion suggestions.
	Completions map[string]interface{} `json:"completions,omitempty" yaml:"completions,omitempty" mapstructure:"completions,omitempty"`

	// Experimental, non-standard capabilities that the server supports.
	Experimental map[string]map[string]interface{} `json:"experimental,omitempty" yaml:"experimental,omitempty" mapstructure:"experimental,omitempty"`

	// Optional MCP extensions that the server supports. Keys are extension
	// identifiers
	// (e.g., "io.modelcontextprotocol/tasks"), and values are per-extension settings
	// objects. An empty object indicates support with no settings.
	//
	// Keys MUST follow the {@link MetaObject`_meta` key naming rules}, with a
	// mandatory prefix.
	Extensions map[string]map[string]interface{} `json:"extensions,omitempty" yaml:"extensions,omitempty" mapstructure:"extensions,omitempty"`

	// Present if the server supports sending log messages to the client.
	Logging map[string]interface{} `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"`

	// Tasks is retained for negotiated 2025-11-25 compatibility. July tasks are
	// negotiated through Extensions instead.
	Tasks *ServerCapabilitiesTasks `json:"tasks,omitempty" yaml:"tasks,omitempty" mapstructure:"tasks,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 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 ServerCapabilitiesTasks deprecated added in v0.8.0

type ServerCapabilitiesTasks = legacy.ServerCapabilitiesTasks

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ServerCapabilitiesTasksRequests deprecated added in v0.8.0

type ServerCapabilitiesTasksRequests = legacy.ServerCapabilitiesTasksRequests

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ServerCapabilitiesTasksRequestsTools deprecated added in v0.8.0

type ServerCapabilitiesTasksRequestsTools = legacy.ServerCapabilitiesTasksRequestsTools

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

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 deprecated

type ServerRequest = legacy.ServerRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ServerResult

type ServerResult interface{}

type SetLevelRequest

type SetLevelRequest struct {
	Id      RequestId             `json:"id" yaml:"id" mapstructure:"id"`
	Jsonrpc string                `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`
	Method  string                `json:"method" yaml:"method" mapstructure:"method"`
	Params  SetLevelRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

SetLevelRequest remains available for legacy sessions while using the root LoggingLevel type expected by existing callers.

type SetLevelRequestParams

type SetLevelRequestParams struct {
	Meta  *SetLevelRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
	Level LoggingLevel               `json:"level" yaml:"level" mapstructure:"level"`
}

type SetLevelRequestParamsMeta deprecated added in v0.8.0

type SetLevelRequestParamsMeta = legacy.SetLevelRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type SetLevelResult

type SetLevelResult EmptyResult

type SingleSelectEnumSchema added in v0.8.0

type SingleSelectEnumSchema interface{}

type StringSchema added in v0.5.0

type StringSchema struct {
	// Default corresponds to the JSON schema field "default".
	Default *string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Description corresponds to the JSON schema field "description".
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Format corresponds to the JSON schema field "format".
	Format *StringSchemaFormat `json:"format,omitempty" yaml:"format,omitempty" mapstructure:"format,omitempty"`

	// MaxLength corresponds to the JSON schema field "maxLength".
	MaxLength *int `json:"maxLength,omitempty" yaml:"maxLength,omitempty" mapstructure:"maxLength,omitempty"`

	// MinLength corresponds to the JSON schema field "minLength".
	MinLength *int `json:"minLength,omitempty" yaml:"minLength,omitempty" mapstructure:"minLength,omitempty"`

	// Title corresponds to the JSON schema field "title".
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

func (*StringSchema) UnmarshalJSON added in v0.5.0

func (j *StringSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StringSchemaFormat added in v0.5.0

type StringSchemaFormat string
const StringSchemaFormatDate StringSchemaFormat = "date"
const StringSchemaFormatDateTime StringSchemaFormat = "date-time"
const StringSchemaFormatEmail StringSchemaFormat = "email"
const StringSchemaFormatUri StringSchemaFormat = "uri"

func (*StringSchemaFormat) UnmarshalJSON added in v0.5.0

func (j *StringSchemaFormat) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StructToPropertiesOption added in v0.3.6

type StructToPropertiesOption func(*structToPropertiesOptions)

StructToPropertiesOption defines an option for controlling field inclusion/exclusion in StructToProperties.

func WithDescriptionHook added in v0.5.0

func WithDescriptionHook(description string) StructToPropertiesOption

WithDescriptionHook create description hook option

func WithFormatHook added in v0.3.6

func WithFormatHook(hook func(field reflect.StructField) string) StructToPropertiesOption

WithFormatHook returns an option to set a hook for overriding field format based on reflect.StructField.

func WithIsRequiredHook added in v0.3.6

func WithIsRequiredHook(hook func(field reflect.StructField) bool) StructToPropertiesOption

WithIsRequiredHook returns an option to set a hook for determining if a field is required based on reflect.StructField.

func WithNullableHook added in v0.3.6

func WithNullableHook(hook func(field reflect.StructField) *bool) StructToPropertiesOption

WithNullableHook returns an option to explicitly set or unset `nullable` for a given struct field. The hook must return a pointer to bool – *true* to force `nullable:true`, *false* to force it off, and *nil* to keep the default behaviour (automatic for pointer types outside slices).

func WithSkipFieldHook added in v0.3.6

func WithSkipFieldHook(hook func(field reflect.StructField) bool) StructToPropertiesOption

WithSkipFieldHook returns an option to set a hook for skipping fields based on reflect.StructField.

type SubscribeRequest deprecated

type SubscribeRequest = legacy.SubscribeRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type SubscribeRequestParams deprecated

type SubscribeRequestParams = legacy.SubscribeRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type SubscribeRequestParamsMeta deprecated added in v0.8.0

type SubscribeRequestParamsMeta = legacy.SubscribeRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type SubscribeResult

type SubscribeResult EmptyResult

type SubscriptionFilter added in v0.15.0

type SubscriptionFilter struct {
	// If true, receive {@link
	// PromptListChangedNotificationnotifications/prompts/list_changed}.
	PromptsListChanged *bool `json:"promptsListChanged,omitempty" yaml:"promptsListChanged,omitempty" mapstructure:"promptsListChanged,omitempty"`

	// Subscribe to {@link ResourceUpdatedNotificationnotifications/resources/updated}
	// for these resource URIs.
	// Replaces the former `resources/subscribe` RPC.
	ResourceSubscriptions []string `json:"resourceSubscriptions,omitempty" yaml:"resourceSubscriptions,omitempty" mapstructure:"resourceSubscriptions,omitempty"`

	// If true, receive {@link
	// ResourceListChangedNotificationnotifications/resources/list_changed}.
	ResourcesListChanged *bool `json:"resourcesListChanged,omitempty" yaml:"resourcesListChanged,omitempty" mapstructure:"resourcesListChanged,omitempty"`

	// If true, receive {@link
	// ToolListChangedNotificationnotifications/tools/list_changed}.
	ToolsListChanged *bool `json:"toolsListChanged,omitempty" yaml:"toolsListChanged,omitempty" mapstructure:"toolsListChanged,omitempty"`
}

The set of notification types a client may opt in to on a {@link SubscriptionsListenRequestsubscriptions/listen} request.

Each notification type is **opt-in**; the server **MUST NOT** send notification types the client has not explicitly requested here.

type SubscriptionsAcknowledgedNotification added in v0.15.0

type SubscriptionsAcknowledgedNotification 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 SubscriptionsAcknowledgedNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

Sent by the server to acknowledge that a {@link SubscriptionsListenRequestsubscriptions/listen} subscription has been established and to report which notification types it agreed to honor.

This notification MUST be the first message the server sends carrying the subscription's ID in `io.modelcontextprotocol/subscriptionId`. The server MUST NOT send any notification on the subscription before acknowledging it. On stdio, where every subscription shares one channel, this ordering is defined per subscription ID and not per channel: messages belonging to other subscriptions MAY be interleaved before it.

func (*SubscriptionsAcknowledgedNotification) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsAcknowledgedNotification) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsAcknowledgedNotificationParams added in v0.15.0

type SubscriptionsAcknowledgedNotificationParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta *NotificationMetaObject `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The subset of requested notification types the server agreed to honor.
	// Only includes notification types the server actually supports; if the
	// client requested an unsupported type (e.g., `promptsListChanged` when
	// the server has no prompts), it is omitted from this set.
	Notifications SubscriptionFilter `json:"notifications" yaml:"notifications" mapstructure:"notifications"`
}

Parameters for a {@link SubscriptionsAcknowledgedNotificationnotifications/subscriptions/acknowledged} notification.

func (*SubscriptionsAcknowledgedNotificationParams) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsAcknowledgedNotificationParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenRequest added in v0.15.0

type SubscriptionsListenRequest 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 SubscriptionsListenRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

Sent from the client to open a long-lived channel for receiving notifications outside the context of a specific request. Replaces the previous HTTP GET endpoint and ensures consistent behavior between HTTP and STDIO.

func (*SubscriptionsListenRequest) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsListenRequest) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenRequestParams added in v0.15.0

type SubscriptionsListenRequestParams struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta RequestMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// The notifications the client opts in to on this stream. The server
	// **MUST NOT** send notification types the client has not explicitly
	// requested.
	Notifications SubscriptionFilter `json:"notifications" yaml:"notifications" mapstructure:"notifications"`
}

Parameters for a {@link SubscriptionsListenRequestsubscriptions/listen} request.

func (*SubscriptionsListenRequestParams) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsListenRequestParams) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResult added in v0.15.0

type SubscriptionsListenResult struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta SubscriptionsListenResultMetaObject `json:"_meta" yaml:"_meta" mapstructure:"_meta"`

	// Indicates the type of the result, which allows the client to determine
	// how to parse the result object.
	//
	// Servers implementing this protocol version MUST include this field.
	// For backward compatibility, when a client receives a result from a
	// server implementing an earlier protocol version (which does not include
	// `resultType`), the client MUST treat the absent field as `"complete"`.
	ResultType string `json:"resultType" yaml:"resultType" mapstructure:"resultType"`
}

The response to a {@link SubscriptionsListenRequestsubscriptions/listen} request, signalling that the subscription has ended gracefully (for example, during server shutdown). Because the listen stream is long-lived, this result is sent only when the server tears the subscription down; an abrupt transport close carries no response. The result body is otherwise empty.

func (*SubscriptionsListenResult) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsListenResult) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResultMetaObject added in v0.15.0

type SubscriptionsListenResultMetaObject struct {
	// Identifies the server software producing the response. Servers SHOULD
	// include this field on every response unless specifically configured not
	// to do so.
	//
	// The {@link Implementation} schema requires `name` and `version`; other
	// fields are optional.
	//
	// The value is self-reported by the server and is not verified by the
	// protocol. It is intended for display, logging, and debugging. Clients
	// SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for
	// security decisions.
	IoModelcontextprotocolServerInfo *Implementation `` /* 163-byte string literal not displayed */

	// Identifies the subscription stream this response closes, so the client can
	// correlate it with the originating subscription — mirroring the same key on
	// the stream's notifications. The value is the JSON-RPC ID of the
	// `subscriptions/listen` request that opened the stream (and equals this
	// response's `id`).
	IoModelcontextprotocolSubscriptionId RequestId `` /* 145-byte string literal not displayed */
}

Extends {@link ResultMetaObject} with the subscription-stream identifier carried by a {@link SubscriptionsListenResult}. All key naming rules from `MetaObject` apply.

func (*SubscriptionsListenResultMetaObject) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsListenResultMetaObject) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResultResponse added in v0.15.0

type SubscriptionsListenResultResponse 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 SubscriptionsListenResult `json:"result" yaml:"result" mapstructure:"result"`
}

A successful response from the server for a {@link SubscriptionsListenRequestsubscriptions/listen} request, sent when the server tears the subscription down gracefully.

func (*SubscriptionsListenResultResponse) UnmarshalJSON added in v0.15.0

func (j *SubscriptionsListenResultResponse) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Task deprecated added in v0.8.0

type Task = legacy.Task

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskAugmentedRequestParams deprecated added in v0.8.0

type TaskAugmentedRequestParams = legacy.TaskAugmentedRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskAugmentedRequestParamsMeta deprecated added in v0.8.0

type TaskAugmentedRequestParamsMeta = legacy.TaskAugmentedRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskMetadata deprecated added in v0.8.0

type TaskMetadata = legacy.TaskMetadata

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskStatus deprecated added in v0.8.0

type TaskStatus = legacy.TaskStatus

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskStatusNotification deprecated added in v0.8.0

type TaskStatusNotification = legacy.TaskStatusNotification

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskStatusNotificationParams deprecated added in v0.8.0

type TaskStatusNotificationParams = legacy.TaskStatusNotificationParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type TaskStatusNotificationTaskStatusNotificationParams added in v0.9.0

type TaskStatusNotificationTaskStatusNotificationParams interface{}

type TextContent

type TextContent struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional annotations for the client.
	Annotations *Annotations `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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TextResourceContents

type TextResourceContents struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchema added in v0.8.0

type TitledMultiSelectEnumSchema struct {
	// Optional default value.
	Default []string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Optional description for the enum field.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Schema for array items with enum options and display labels.
	Items TitledMultiSelectEnumSchemaItems `json:"items" yaml:"items" mapstructure:"items"`

	// Maximum number of items to select.
	MaxItems *int `json:"maxItems,omitempty" yaml:"maxItems,omitempty" mapstructure:"maxItems,omitempty"`

	// Minimum number of items to select.
	MinItems *int `json:"minItems,omitempty" yaml:"minItems,omitempty" mapstructure:"minItems,omitempty"`

	// Optional title for the enum field.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Schema for multiple-selection enumeration with display titles for each option.

func (*TitledMultiSelectEnumSchema) UnmarshalJSON added in v0.8.0

func (j *TitledMultiSelectEnumSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItems added in v0.8.0

type TitledMultiSelectEnumSchemaItems struct {
	// Array of enum options with values and display labels.
	AnyOf []TitledMultiSelectEnumSchemaItemsAnyOfElem `json:"anyOf" yaml:"anyOf" mapstructure:"anyOf"`
}

Schema for array items with enum options and display labels.

func (*TitledMultiSelectEnumSchemaItems) UnmarshalJSON added in v0.8.0

func (j *TitledMultiSelectEnumSchemaItems) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItemsAnyOfElem added in v0.8.0

type TitledMultiSelectEnumSchemaItemsAnyOfElem struct {
	// The constant enum value.
	Const string `json:"const" yaml:"const" mapstructure:"const"`

	// Display title for this option.
	Title string `json:"title" yaml:"title" mapstructure:"title"`
}

func (*TitledMultiSelectEnumSchemaItemsAnyOfElem) UnmarshalJSON added in v0.8.0

func (j *TitledMultiSelectEnumSchemaItemsAnyOfElem) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchema added in v0.8.0

type TitledSingleSelectEnumSchema struct {
	// Optional default value.
	Default *string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Optional description for the enum field.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Array of enum options with values and display labels.
	OneOf []TitledSingleSelectEnumSchemaOneOfElem `json:"oneOf" yaml:"oneOf" mapstructure:"oneOf"`

	// Optional title for the enum field.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Schema for single-selection enumeration with display titles for each option.

func (*TitledSingleSelectEnumSchema) UnmarshalJSON added in v0.8.0

func (j *TitledSingleSelectEnumSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchemaOneOfElem added in v0.8.0

type TitledSingleSelectEnumSchemaOneOfElem struct {
	// The enum value.
	Const string `json:"const" yaml:"const" mapstructure:"const"`

	// Display label for this option.
	Title string `json:"title" yaml:"title" mapstructure:"title"`
}

func (*TitledSingleSelectEnumSchemaOneOfElem) UnmarshalJSON added in v0.8.0

func (j *TitledSingleSelectEnumSchemaOneOfElem) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Tool

type Tool struct {
	// Meta corresponds to the JSON schema field "_meta".
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Optional additional tool information.
	//
	// Display name precedence order is: `title`, `annotations.title`, then `name`.
	Annotations *ToolAnnotations `json:"annotations,omitempty" yaml:"annotations,omitempty" mapstructure:"annotations,omitempty"`

	// A human-readable description of the tool.
	//
	// This can be used by clients to improve the LLM's understanding of available
	// tools. It can be thought of like a "hint" to the model.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Optional set of sized icons that the client can display in a user interface.
	//
	// Clients that support rendering icons MUST support at least the following MIME
	// types:
	// - `image/png` - PNG images (safe, universal compatibility)
	// - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
	//
	// Clients that support rendering icons SHOULD also support:
	// - `image/svg+xml` - SVG images (scalable but requires security precautions)
	// - `image/webp` - WebP images (modern, efficient format)
	Icons []Icon `json:"icons,omitempty" yaml:"icons,omitempty" mapstructure:"icons,omitempty"`

	// A JSON Schema object defining the expected parameters for the tool.
	//
	// Tool arguments are always JSON objects, so `type: "object"` is required at the
	// root.
	// Beyond that, any JSON Schema 2020-12 keyword may appear alongside `type` —
	// including
	// composition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords
	// (`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any
	// other
	// standard validation or annotation keywords.
	//
	// Property schemas may carry an `x-mcp-header` annotation to mirror the
	// argument value into an HTTP header on the Streamable HTTP transport. See
	// the Streamable HTTP transport specification for the validity and
	// extraction rules.
	//
	// Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.
	InputSchema ToolInputSchema `json:"inputSchema" yaml:"inputSchema" mapstructure:"inputSchema"`

	// Intended for programmatic or logical use, but used as a display name in past
	// specs or fallback (if title isn't present).
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// An optional JSON Schema object defining the structure of the tool's output
	// returned in
	// the structuredContent field of a {@link CallToolResult}. This can be any valid
	// JSON Schema 2020-12.
	//
	// Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.
	OutputSchema *ToolOutputSchema `json:"outputSchema,omitempty" yaml:"outputSchema,omitempty" mapstructure:"outputSchema,omitempty"`

	// Intended for UI and end-user contexts — optimized to be human-readable and
	// easily understood,
	// even by those unfamiliar with domain-specific terminology.
	//
	// If not provided, the name should be used for display (except for {@link Tool},
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`
}

Definition for a tool the client can call.

func (*Tool) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolAnnotations

type ToolAnnotations struct {
	// If true, the tool may perform destructive updates to its environment.
	// If false, the tool performs only additive updates.
	//
	// (This property is meaningful only when `readOnlyHint == false`)
	//
	// Default: true
	DestructiveHint *bool `json:"destructiveHint,omitempty" yaml:"destructiveHint,omitempty" mapstructure:"destructiveHint,omitempty"`

	// If true, calling the tool repeatedly with the same arguments
	// will have no additional effect on its environment.
	//
	// (This property is meaningful only when `readOnlyHint == false`)
	//
	// Default: false
	IdempotentHint *bool `json:"idempotentHint,omitempty" yaml:"idempotentHint,omitempty" mapstructure:"idempotentHint,omitempty"`

	// If true, this tool may interact with an "open world" of external
	// entities. If false, the tool's domain of interaction is closed.
	// For example, the world of a web search tool is open, whereas that
	// of a memory tool is not.
	//
	// Default: true
	OpenWorldHint *bool `json:"openWorldHint,omitempty" yaml:"openWorldHint,omitempty" mapstructure:"openWorldHint,omitempty"`

	// If true, the tool does not modify its environment.
	//
	// Default: false
	ReadOnlyHint *bool `json:"readOnlyHint,omitempty" yaml:"readOnlyHint,omitempty" mapstructure:"readOnlyHint,omitempty"`

	// A human-readable title for the tool.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`
}

Additional properties describing a {@link Tool} to clients.

NOTE: all properties in `ToolAnnotations` are **hints**. They are not guaranteed to provide a faithful description of tool behavior (including descriptive properties like `title`).

Clients should never make tool use decisions based on `ToolAnnotations` received from untrusted servers.

type ToolChoice added in v0.8.0

type ToolChoice struct {
	// Controls the tool use ability of the model:
	// - `"auto"`: Model decides whether to use tools (default)
	// - `"required"`: Model MUST use at least one tool before completing
	// - `"none"`: Model MUST NOT use any tools
	Mode *ToolChoiceMode `json:"mode,omitempty" yaml:"mode,omitempty" mapstructure:"mode,omitempty"`
}

Controls tool selection behavior for sampling requests.

type ToolChoiceMode added in v0.8.0

type ToolChoiceMode string
const ToolChoiceModeAuto ToolChoiceMode = "auto"
const ToolChoiceModeNone ToolChoiceMode = "none"
const ToolChoiceModeRequired ToolChoiceMode = "required"

func (*ToolChoiceMode) UnmarshalJSON added in v0.8.0

func (j *ToolChoiceMode) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ToolExecution deprecated added in v0.8.0

type ToolExecution = legacy.ToolExecution

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ToolExecutionTaskSupport deprecated added in v0.8.0

type ToolExecutionTaskSupport = legacy.ToolExecutionTaskSupport

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type ToolInputSchema

type ToolInputSchema struct {
	// Schema corresponds to the JSON schema field "$schema".
	Schema *string `json:"$schema,omitempty" yaml:"$schema,omitempty" mapstructure:"$schema,omitempty"`

	// Properties is retained for source compatibility with the 2025-11-25 root
	// schema API. July permits the full JSON Schema 2020-12 vocabulary.
	Properties ToolInputSchemaProperties `json:"properties,omitempty" yaml:"properties,omitempty" mapstructure:"properties,omitempty"`

	// Required is retained for source compatibility with the 2025-11-25 root
	// schema API.
	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"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

A JSON Schema object defining the expected parameters for the tool.

Tool arguments are always JSON objects, so `type: "object"` is required at the root. Beyond that, any JSON Schema 2020-12 keyword may appear alongside `type` — including composition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords (`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any other standard validation or annotation keywords.

Property schemas may carry an `x-mcp-header` annotation to mirror the argument value into an HTTP header on the Streamable HTTP transport. See the Streamable HTTP transport specification for the validity and extraction rules.

Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.

func (*ToolInputSchema) Load

func (s *ToolInputSchema) Load(v any, options ...StructToPropertiesOption) error

func (*ToolInputSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolInputSchemaProperties

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

ToolInputSchemaProperties preserves the root package's pre-July API while ToolInputSchema.AdditionalProperties carries other JSON Schema 2020-12 keys.

func StructToProperties added in v0.3.6

func StructToProperties(t reflect.Type, opts ...StructToPropertiesOption) (ToolInputSchemaProperties, []string)

StructToProperties converts a struct type into MCP InputSchema properties and required fields. Fields tagged with mcp:"-" are excluded from the generated schema without affecting their JSON encoding behavior. It accepts optional StructToPropertiesOption to customize behavior (e.g., skipping fields, required logic, format overrides).

type ToolListChangedNotification

type ToolListChangedNotification 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 *NotificationParams `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 is only delivered on a {@link SubscriptionsListenRequestsubscriptions/listen} stream when the client requested it via the `toolsListChanged` filter field.

func (*ToolListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolOutputSchema added in v0.3.6

type ToolOutputSchema struct {
	// Schema corresponds to the JSON schema field "$schema".
	Schema *string `json:"$schema,omitempty" yaml:"$schema,omitempty" mapstructure:"$schema,omitempty"`

	// Properties is retained for source compatibility with the 2025-11-25 root
	// schema API.
	Properties ToolInputSchemaProperties `json:"properties,omitempty" yaml:"properties,omitempty" mapstructure:"properties,omitempty"`

	// Required is retained for source compatibility with the 2025-11-25 root
	// schema API.
	Required []string `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"`

	// Type is retained for source compatibility with the 2025-11-25 root schema
	// API. July output schemas may omit it.
	Type string `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

An optional JSON Schema object defining the structure of the tool's output returned in the structuredContent field of a {@link CallToolResult}. This can be any valid JSON Schema 2020-12.

Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.

func (*ToolOutputSchema) Load added in v0.3.12

func (s *ToolOutputSchema) Load(v any, options ...StructToPropertiesOption) error

type ToolResultContent added in v0.8.0

type ToolResultContent struct {
	// Optional metadata about the tool result. Clients SHOULD preserve this field
	// when
	// including tool results in subsequent sampling requests to enable caching
	// optimizations.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The unstructured result content of the tool use.
	//
	// This has the same format as {@link CallToolResult.content} and can include
	// text, images,
	// audio, resource links, and embedded resources.
	Content []ToolResultContentContentElem `json:"content" yaml:"content" mapstructure:"content"`

	// Whether the tool use resulted in an error.
	//
	// If true, the content typically describes the error that occurred.
	// Default: false
	IsError *bool `json:"isError,omitempty" yaml:"isError,omitempty" mapstructure:"isError,omitempty"`

	// An optional structured result value.
	//
	// This can be any JSON value (object, array, string, number, boolean, or null).
	// If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that
	// schema.
	StructuredContent interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`

	// The ID of the tool use this result corresponds to.
	//
	// This MUST match the ID from a previous {@link ToolUseContent}.
	ToolUseId string `json:"toolUseId" yaml:"toolUseId" mapstructure:"toolUseId"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

The result of a tool use, provided by the user back to the assistant.

func (*ToolResultContent) UnmarshalJSON added in v0.8.0

func (j *ToolResultContent) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ToolResultContentContentElem added in v0.8.0

type ToolResultContentContentElem interface{}

type ToolUseContent added in v0.8.0

type ToolUseContent struct {
	// Optional metadata about the tool use. Clients SHOULD preserve this field when
	// including tool uses in subsequent sampling requests to enable caching
	// optimizations.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// A unique identifier for this tool use.
	//
	// This ID is used to match tool results to their corresponding tool uses.
	Id string `json:"id" yaml:"id" mapstructure:"id"`

	// The arguments to pass to the tool, conforming to the tool's input schema.
	Input map[string]interface{} `json:"input" yaml:"input" mapstructure:"input"`

	// The name of the tool to call.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

A request from the assistant to call a tool.

func (*ToolUseContent) UnmarshalJSON added in v0.8.0

func (j *ToolUseContent) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type URLElicitRequestParamsMeta added in v0.5.5

type URLElicitRequestParamsMeta = ElicitRequestURLParamsMeta

type URLElicitationRequiredError deprecated added in v0.8.0

type URLElicitationRequiredError = legacy.URLElicitationRequiredError

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type URLElicitationRequiredErrorError deprecated added in v0.8.0

type URLElicitationRequiredErrorError = legacy.URLElicitationRequiredErrorError

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type URLElicitationRequiredErrorErrorData deprecated added in v0.8.0

type URLElicitationRequiredErrorErrorData = legacy.URLElicitationRequiredErrorErrorData

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type UnsubscribeRequest deprecated

type UnsubscribeRequest = legacy.UnsubscribeRequest

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type UnsubscribeRequestParams deprecated

type UnsubscribeRequestParams = legacy.UnsubscribeRequestParams

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type UnsubscribeRequestParamsMeta deprecated added in v0.8.0

type UnsubscribeRequestParamsMeta = legacy.UnsubscribeRequestParamsMeta

Deprecated: these aliases preserve the pre-July root-package API. New code should import schema/2025-11-25 explicitly when speaking the legacy protocol.

type UnsubscribeResult

type UnsubscribeResult EmptyResult

type UnsupportedProtocolVersionError added in v0.15.0

type UnsupportedProtocolVersionError struct {
	// Error corresponds to the JSON schema field "error".
	Error UnsupportedProtocolVersionErrorError `json:"error" yaml:"error" mapstructure:"error"`

	// Id corresponds to the JSON schema field "id".
	Id *RequestId `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`

	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`
}

Returned when the request's protocol version is unknown to the server or unsupported (e.g., a known experimental or draft version the server has chosen not to implement). For HTTP, the response status code MUST be `400 Bad Request`.

func (*UnsupportedProtocolVersionError) UnmarshalJSON added in v0.15.0

func (j *UnsupportedProtocolVersionError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UnsupportedProtocolVersionErrorError added in v0.15.0

type UnsupportedProtocolVersionErrorError 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 MissingRequiredClientCapabilityErrorErrorData `json:"data" yaml:"data" mapstructure:"data"`

	// 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 (*UnsupportedProtocolVersionErrorError) UnmarshalJSON added in v0.15.0

func (j *UnsupportedProtocolVersionErrorError) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UntitledMultiSelectEnumSchema added in v0.8.0

type UntitledMultiSelectEnumSchema struct {
	// Optional default value.
	Default []string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Optional description for the enum field.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Schema for the array items.
	Items UntitledMultiSelectEnumSchemaItems `json:"items" yaml:"items" mapstructure:"items"`

	// Maximum number of items to select.
	MaxItems *int `json:"maxItems,omitempty" yaml:"maxItems,omitempty" mapstructure:"maxItems,omitempty"`

	// Minimum number of items to select.
	MinItems *int `json:"minItems,omitempty" yaml:"minItems,omitempty" mapstructure:"minItems,omitempty"`

	// Optional title for the enum field.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Schema for multiple-selection enumeration without display titles for options.

func (*UntitledMultiSelectEnumSchema) UnmarshalJSON added in v0.8.0

func (j *UntitledMultiSelectEnumSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UntitledMultiSelectEnumSchemaItems added in v0.8.0

type UntitledMultiSelectEnumSchemaItems struct {
	// Array of enum values to choose from.
	Enum []string `json:"enum" yaml:"enum" mapstructure:"enum"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Schema for the array items.

func (*UntitledMultiSelectEnumSchemaItems) UnmarshalJSON added in v0.8.0

func (j *UntitledMultiSelectEnumSchemaItems) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

type UntitledSingleSelectEnumSchema added in v0.8.0

type UntitledSingleSelectEnumSchema struct {
	// Optional default value.
	Default *string `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Optional description for the enum field.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Array of enum values to choose from.
	Enum []string `json:"enum" yaml:"enum" mapstructure:"enum"`

	// Optional title for the enum field.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

Schema for single-selection enumeration without display titles for options.

func (*UntitledSingleSelectEnumSchema) UnmarshalJSON added in v0.8.0

func (j *UntitledSingleSelectEnumSchema) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

Directories

Path Synopsis
Package schema (draft) contains experimental code generated from a draft version of the Model Context Protocol JSON schema.
Package schema (draft) contains experimental code generated from a draft version of the Model Context Protocol JSON schema.

Jump to

Keyboard shortcuts

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