schema

package
v0.0.0-...-d52a2f3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 17 Imported by: 2 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"
)
View Source
const DirectoryMimeType = "inode/directory"

DirectoryMimeType is the mimeType of a directory resource.

View Source
const MethodResourcesDirectoryRead = "resources/directory/read"

MethodResourcesDirectoryRead lists the direct children of a directory resource. SEP-2640 defines it; a server offers it only when its skills extension settings carry SkillsDirectoryRead: true.

View Source
const MethodSkillsGet = "skills/get"
View Source
const MethodSkillsList = "skills/list"
View Source
const SkillsDirectoryRead = "directoryRead"

SkillsDirectoryRead is the skills extension setting that declares resources/directory/read.

View Source
const SkillsExtension = "io.modelcontextprotocol/skills"
View Source
const SkillsMetaPrefix = "io.modelcontextprotocol.skills/"

SkillsMetaPrefix is the _meta key prefix SEP-2640 reserves for keys it defines on skills and skill resources. Intermediaries use their own prefix.

View Source
const ToolErrorHTTPStatusMetaKey = "io.viant/http-status"

ToolErrorHTTPStatusMetaKey is an optional Viant extension, not an MCP standard. It preserves a producer's typed HTTP failure status outside its public body. It classifies a tool failure only; it never grants access or replaces isError.

Variables

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

SupportedProtocolVersions is ordered by preference.

Functions

func IsProtocolNewer

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

func SetToolErrorHTTPStatus

func SetToolErrorHTTPStatus(result *CallToolResult, status int) bool

SetToolErrorHTTPStatus attaches a typed 400–599 status to an error result. Metadata is copied so unrelated results sharing it remain unchanged. Explicit content, structuredContent, server identity and other extensions are retained.

func ToolErrorHTTPStatus

func ToolErrorHTTPStatus(result *CallToolResult) (int, bool)

ToolErrorHTTPStatus accepts only numeric integral 400–599 metadata on an isError result. Strings, fractional values and metadata on successes are ignored.

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type CacheableResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type CacheableResultCacheScope

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

func (*CacheableResultCacheScope) UnmarshalJSON

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultResponseResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultResponseResult_0

type CallToolResultResponseResult_0 = InputRequiredResult

type CallToolResultResponseResult_1

type CallToolResultResponseResult_1 = CallToolResult

type CancelTaskRequest deprecated

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

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

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

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

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

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

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

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type ContentBlock

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

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

type CreateMessageResultContent_3 = ToolUseContent

type CreateMessageResultContent_4

type CreateMessageResultContent_4 = ToolResultContent

type CreateMessageResultContent_5

type CreateMessageResultContent_5 []SamplingMessageContentBlock

func (*CreateMessageResultContent_5) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent_5Elem

type CreateMessageResultContent_5Elem interface{}

type CreateTaskResult deprecated

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResultCacheScope

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

func (*DiscoverResultCacheScope) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type DiscoverResultResponse

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequest

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestElicitRequestParams

type ElicitRequestElicitRequestParams interface{}

type ElicitRequestFormParams

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestFormParamsMeta deprecated

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParams

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

type ElicitRequestParamsMode string

type ElicitRequestParamsRequestedSchema

type ElicitRequestParamsRequestedSchema = ElicitRequestFormParamsRequestedSchema

type ElicitRequestParamsUnion

type ElicitRequestParamsUnion interface{}

type ElicitRequestParams_1

type ElicitRequestParams_1 interface{}

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

type ElicitRequestURLParams

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestURLParamsMeta deprecated

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitResultAction

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

func (*ElicitResultAction) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationCapability

type ElicitationCapability struct {
	Enabled        bool     `json:"enabled"`        // Whether elicitation is supported
	SupportedModes []string `json:"supportedModes"` // Supported modes: "form", "url"
}

ElicitationCapability describes the client's elicitation support

type ElicitationCompleteNotification deprecated

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

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 ElicitationCreateRequest

type ElicitationCreateRequest struct {
	Message    string                 `json:"message"`              // Explanation of why input is needed
	Mode       string                 `json:"mode"`                 // "form" or "url"
	FormSchema map[string]interface{} `json:"formSchema,omitempty"` // JSON schema for form mode
	URL        string                 `json:"url,omitempty"`        // URL for url mode
}

ElicitationCreateRequest represents a request for user input

type ElicitationCreateResponse

type ElicitationCreateResponse struct {
	Action  string                 `json:"action"`  // "accept", "decline", or "cancel"
	Content map[string]interface{} `json:"content"` // Form data (form mode) or result (url mode)
}

ElicitationCreateResponse represents the response from an elicitation request

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 NewEmbeddedBlob

func NewEmbeddedBlob(uri, media string, data []byte) EmbeddedResource

NewEmbeddedBlob creates the blob alternative without interpreting payload bytes, including an empty blob. It is available in every protocol version.

func NewEmbeddedText

func NewEmbeddedText(uri, media, text string) EmbeddedResource

NewEmbeddedText records explicit text intent, including empty text.

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"`
	// contains filtered or unexported fields
}

func (EmbeddedResourceResource) MarshalJSON

func (r EmbeddedResourceResource) MarshalJSON() ([]byte, error)

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultResponseResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResultResponseResult_0

type GetPromptResultResponseResult_0 = InputRequiredResult

type GetPromptResultResponseResult_1

type GetPromptResultResponseResult_1 = GetPromptResult

type GetSkillRequest

type GetSkillRequest struct {
	Method string                `json:"method"`
	Params GetSkillRequestParams `json:"params"`
}

type GetSkillRequestParams

type GetSkillRequestParams struct {
	Uri  string                 `json:"uri"`
	Meta map[string]interface{} `json:"_meta,omitempty"`
}

type GetSkillResult

type GetSkillResult struct {
	TtlMs      *int                      `json:"ttlMs,omitempty"`
	CacheScope CacheableResultCacheScope `json:"cacheScope,omitempty"`
	Meta       *ResultMetaObject         `json:"_meta,omitempty"`
	ResultType string                    `json:"resultType,omitempty"`
	Skill      Skill                     `json:"skill"`
}

type GetTaskPayloadRequest deprecated

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

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

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type HeaderMismatchErrorError

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

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

UnmarshalJSON implements json.Unmarshaler.

type Icon

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

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

UnmarshalJSON implements json.Unmarshaler.

type IconTheme

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

func (*IconTheme) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type Icons

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

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

type InputRequest interface{}

type InputRequiredResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type InputResponse

type InputResponse interface{}

type InputResponseRequestParams

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

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

UnmarshalJSON implements json.Unmarshaler.

type InternalError

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

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

UnmarshalJSON implements json.Unmarshaler.

type InvalidParamsError

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

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

UnmarshalJSON implements json.Unmarshaler.

type InvalidRequestError

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

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

UnmarshalJSON implements json.Unmarshaler.

type JSONArray

type JSONArray []interface{}

type JSONRPCErrorResponse

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type JSONValue

type JSONValue interface{}

type LegacyTitledEnumSchema

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

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

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

func (*ListPromptsResultCacheScope) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsResultResponse

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

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

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

func (*ListResourceTemplatesResultCacheScope) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesResultResponse

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

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

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

func (*ListResourcesResultCacheScope) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesResultResponse

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

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 ListSkillsRequest

type ListSkillsRequest struct {
	Method string                  `json:"method"`
	Params ListSkillsRequestParams `json:"params"`
}

type ListSkillsRequestParams

type ListSkillsRequestParams struct {
	Cursor *string                `json:"cursor,omitempty"`
	Meta   map[string]interface{} `json:"_meta,omitempty"`
}

func (*ListSkillsRequestParams) UnmarshalJSON

func (p *ListSkillsRequestParams) UnmarshalJSON(raw []byte) error

type ListSkillsResult

type ListSkillsResult struct {
	Meta       *ResultMetaObject         `json:"_meta,omitempty"`
	ResultType string                    `json:"resultType,omitempty"`
	Skills     []Skill                   `json:"skills"`
	NextCursor *string                   `json:"nextCursor,omitempty"`
	TtlMs      *int                      `json:"ttlMs,omitempty"`
	CacheScope CacheableResultCacheScope `json:"cacheScope,omitempty"`
}

type ListTasksRequest deprecated

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

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

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

func (*ListToolsResultCacheScope) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListToolsResultResponse

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

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 Message

type Message struct {
	Role    string      `json:"role"`    // "user", "assistant", or "system"
	Content interface{} `json:"content"` // string or object for multi-modal
}

Message represents a message in a conversation for sampling

type MethodNotFoundError

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

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

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityError

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

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

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityErrorError

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

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

UnmarshalJSON implements json.Unmarshaler.

type MissingRequiredClientCapabilityErrorErrorData

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type NumberSchemaType

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

func (*NumberSchemaType) UnmarshalJSON

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

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

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequestParamsMeta deprecated

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

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

UnmarshalJSON implements json.Unmarshaler.

type ParseError

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

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

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 ReadResourceDirectoryRequest

type ReadResourceDirectoryRequest struct {
	Method string                             `json:"method"`
	Params ReadResourceDirectoryRequestParams `json:"params"`
}

ReadResourceDirectoryRequest is SEP-2640's resources/directory/read.

type ReadResourceDirectoryRequestParams

type ReadResourceDirectoryRequestParams struct {
	// Uri is the directory resource, written without a trailing slash.
	Uri    string                 `json:"uri"`
	Cursor *string                `json:"cursor,omitempty"`
	Meta   map[string]interface{} `json:"_meta,omitempty"`
}

func (*ReadResourceDirectoryRequestParams) UnmarshalJSON

func (p *ReadResourceDirectoryRequestParams) UnmarshalJSON(raw []byte) error

type ReadResourceDirectoryResult

type ReadResourceDirectoryResult struct {
	Meta       *ResultMetaObject         `json:"_meta,omitempty"`
	ResultType string                    `json:"resultType,omitempty"`
	Resources  []Resource                `json:"resources"`
	NextCursor *string                   `json:"nextCursor,omitempty"`
	TtlMs      *int                      `json:"ttlMs,omitempty"`
	CacheScope CacheableResultCacheScope `json:"cacheScope,omitempty"`
}

ReadResourceDirectoryResult lists a directory's direct children: files with their ordinary resource metadata, subdirectories with DirectoryMimeType.

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

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

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

func (*ReadResourceResultCacheScope) UnmarshalJSON

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResultContentsElem

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

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultResponseResultContentsElem_0

type ReadResourceResultResponseResultContentsElem_0 = TextResourceContents

type ReadResourceResultResponseResultContentsElem_1

type ReadResourceResultResponseResultContentsElem_1 = BlobResourceContents

type ReadResourceResultResponseResult_0

type ReadResourceResultResponseResult_0 = InputRequiredResult

type ReadResourceResultResponseResult_1

type ReadResourceResultResponseResult_1 = ReadResourceResult

type RelatedTaskMetadata deprecated

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

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

	AdditionalProperties interface{} `json:"-" yaml:"-" mapstructure:",remain"`
}

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

func (RequestMetaObject) MarshalJSON

func (j RequestMetaObject) MarshalJSON() ([]byte, error)

MarshalJSON preserves request metadata extensions while keeping standard protocol fields authoritative. It complements RequestMetaObject.UnmarshalJSON.

func (*RequestMetaObject) UnmarshalJSON

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceRequestParamsMeta deprecated

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

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

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{} `json:"-" mapstructure:",remain"`
}

Common result fields.

func (*Result) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResultMetaObject

type ResultMetaObject struct {
	// AdditionalProperties preserves application and protocol extension metadata.
	AdditionalProperties interface{} `json:"-" yaml:",inline" mapstructure:",remain"`
	// 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.

func (ResultMetaObject) MarshalJSON

func (m ResultMetaObject) MarshalJSON() ([]byte, error)

MarshalJSON keeps extension keys at the _meta object's top level. The typed server identity is authoritative and cannot be overridden by the catchall.

func (*ResultMetaObject) UnmarshalJSON

func (m *ResultMetaObject) UnmarshalJSON(data []byte) error

UnmarshalJSON retains unknown metadata instead of silently dropping it.

type ResultType

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 SamplingCapability

type SamplingCapability struct {
	Enabled       bool `json:"enabled"`       // Whether sampling is supported
	SupportsTools bool `json:"supportsTools"` // Whether tool-enabled sampling is supported
}

SamplingCapability describes the client's sampling support

type SamplingCreateMessageRequest

type SamplingCreateMessageRequest struct {
	Messages         []Message         `json:"messages"`                   // Array of conversation messages
	ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty"` // Optional model selection preferences
	SystemPrompt     *string           `json:"systemPrompt,omitempty"`     // Optional system prompt
	MaxTokens        *int              `json:"maxTokens,omitempty"`        // Optional maximum tokens to generate
	Temperature      *float64          `json:"temperature,omitempty"`      // Optional temperature (0-1)
	Tools            []Tool            `json:"tools,omitempty"`            // Optional tools for tool-enabled sampling
}

SamplingCreateMessageRequest represents a request to create an LLM completion

type SamplingCreateMessageResponse

type SamplingCreateMessageResponse struct {
	Content    string     `json:"content"`    // The generated text content
	Model      string     `json:"model"`      // The model used for generation
	StopReason string     `json:"stopReason"` // Why generation stopped (e.g., "end_turn", "max_tokens")
	Usage      TokenUsage `json:"usage"`      // Token usage statistics
}

SamplingCreateMessageResponse represents the response from a sampling request

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

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

type SamplingMessageContent_3 = ToolUseContent

type SamplingMessageContent_4

type SamplingMessageContent_4 = ToolResultContent

type SamplingMessageContent_5

type SamplingMessageContent_5 []SamplingMessageContentBlock

func (*SamplingMessageContent_5) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContent_5Elem

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

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

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

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

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

type SingleSelectEnumSchema interface{}

type Skill

type Skill struct {
	Uri         string                 `json:"uri"`
	Frontmatter map[string]interface{} `json:"frontmatter"`
	Resources   SkillResources         `json:"resources"`
	// Meta is the entry's _meta object. SEP-2640 assigns it no keys yet.
	Meta map[string]interface{} `json:"_meta,omitempty"`
}

Skill is SEP-2640 metadata, not file content or an execution permission.

func (*Skill) UnmarshalJSON

func (s *Skill) UnmarshalJSON(raw []byte) error

type SkillResource

type SkillResource struct {
	Uri    string `json:"uri"`
	Digest string `json:"digest"`
	Size   int64  `json:"size"`
}

func (*SkillResource) UnmarshalJSON

func (s *SkillResource) UnmarshalJSON(raw []byte) error

type SkillResources

type SkillResources struct {
	Files   []SkillResource
	Dynamic bool
}

SkillResources represents the extension's array-or-"dynamic" union.

func (SkillResources) MarshalJSON

func (r SkillResources) MarshalJSON() ([]byte, error)

func (*SkillResources) UnmarshalJSON

func (r *SkillResources) UnmarshalJSON(data []byte) error

type StringSchema

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

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

UnmarshalJSON implements json.Unmarshaler.

type StringSchemaFormat

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

func (*StringSchemaFormat) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type StructToPropertiesOption

type StructToPropertiesOption func(*structToPropertiesOptions)

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

func WithDescriptionHook

func WithDescriptionHook(description string) StructToPropertiesOption

WithDescriptionHook create description hook option

func WithFormatHook

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

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

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsAcknowledgedNotificationParams

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenRequest

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenRequestParams

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResult

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResultMetaObject

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

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

UnmarshalJSON implements json.Unmarshaler.

type SubscriptionsListenResultResponse

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

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

UnmarshalJSON implements json.Unmarshaler.

type Task deprecated

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

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

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

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

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItems

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

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

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItemsAnyOfElem

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

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

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchema

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

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

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchemaOneOfElem

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

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

UnmarshalJSON implements json.Unmarshaler.

type TokenUsage

type TokenUsage struct {
	InputTokens  int `json:"inputTokens"`  // Number of tokens in the input
	OutputTokens int `json:"outputTokens"` // Number of tokens in the output
}

TokenUsage represents token usage statistics

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

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

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

func (*ToolChoiceMode) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolExecution deprecated

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

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{} `json:"-" yaml:"-" 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) MarshalJSON

func (j ToolInputSchema) MarshalJSON() ([]byte, error)

MarshalJSON flattens the JSON Schema vocabulary held in the generated catchall. Typed core fields always win; extension keys cannot replace them.

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

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

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{} `json:"-" yaml:"-" 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

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

func (ToolOutputSchema) MarshalJSON

func (s ToolOutputSchema) MarshalJSON() ([]byte, error)

MarshalJSON preserves the output schema vocabulary on the wire.

func (*ToolOutputSchema) UnmarshalJSON

func (s *ToolOutputSchema) UnmarshalJSON(data []byte) error

UnmarshalJSON preserves output vocabulary, including schemas with no type.

type ToolResultContent

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

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

UnmarshalJSON implements json.Unmarshaler.

type ToolResultContentContentElem

type ToolResultContentContentElem interface{}

type ToolUseContent

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

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitRequestParamsMeta

type URLElicitRequestParamsMeta = ElicitRequestURLParamsMeta

type URLElicitationRequiredError deprecated

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

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

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

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

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

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

UnmarshalJSON implements json.Unmarshaler.

type UnsupportedProtocolVersionErrorError

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

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

UnmarshalJSON implements json.Unmarshaler.

type UntitledMultiSelectEnumSchema

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

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

UnmarshalJSON implements json.Unmarshaler.

type UntitledMultiSelectEnumSchemaItems

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

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

UnmarshalJSON implements json.Unmarshaler.

type UntitledSingleSelectEnumSchema

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

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.
Package fieldname resolves explicitly authored MCP field identities.
Package fieldname resolves explicitly authored MCP field identities.
internal
requestmetagen command
Command requestmetagen regenerates the extensible request metadata carrier without replacing other maintained protocol compatibility projections.
Command requestmetagen regenerates the extensible request metadata carrier without replacing other maintained protocol compatibility projections.
resourcecontent
Package resourcecontent owns blob/text alternative selection for every native MCP schema version.
Package resourcecontent owns blob/text alternative selection for every native MCP schema version.
toolschemagen command
Command toolschemagen maintains JSON Schema extension carriers after generation.
Command toolschemagen maintains JSON Schema extension carriers after generation.
Package jsonschema compiles native MCP JSON schemas from canonical type and resource owners.
Package jsonschema compiles native MCP JSON schemas from canonical type and resource owners.

Jump to

Keyboard shortcuts

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