schema

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 35

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 (
	LatestProtocolVersion   = "2025-06-18"
	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 (
	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"
	MethodRootsList                   = "roots/list"
	MethodSamplingCreateMessage       = "sampling/createMessage"
	MethodElicitationCreate           = "elicitation/create"
)

JSON-RPC method names for MCP protocol

Variables

This section is empty.

Functions

func IsProtocolNewer added in v0.3.8

func IsProtocolNewer(current, reference string) bool

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

Example:

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

func MustParseParams

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

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

func NewInvalidPromptName

func NewInvalidPromptName(name string) *jsonrpc.Error

NewInvalidPromptName creates a new invalid prompt name

func NewResourceNotFound

func NewResourceNotFound(uri string) *jsonrpc.Error

NewResourceNotFound creates a new resource not found

func NewUnknownTool

func NewUnknownTool(toolName string) *jsonrpc.Error

Types

type Annotations

type Annotations struct {
	// Describes who the intended audience of this object or data is.
	//
	// It can include multiple entries to indicate content useful for multiple
	// audiences (e.g., `["user", "assistant"]`).
	Audience []Role `json:"audience,omitempty" yaml:"audience,omitempty" mapstructure:"audience,omitempty"`

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

	// Describes how important this data is for operating the server.
	//
	// A value of 1 means "most important," and indicates that the data is
	// effectively required, while 0 means "least important," and indicates that
	// the data is entirely optional.
	Priority *float64 `json:"priority,omitempty" yaml:"priority,omitempty" mapstructure:"priority,omitempty"`
}

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

func (*Annotations) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type AudioContent

type AudioContent struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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

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

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

Audio provided to or from an LLM.

func (*AudioContent) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type BaseMetadata added in v0.5.0

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

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

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

func (*BaseMetadata) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type BlobResourceContents

type BlobResourceContents struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// A base64-encoded string representing the binary data of the item.
	Blob string `json:"blob" yaml:"blob" mapstructure:"blob"`

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

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

func (*BlobResourceContents) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type BooleanSchema added in v0.5.0

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

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

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

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

func (*BooleanSchema) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type 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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *CallToolRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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

	// If specified, the caller is requesting task-augmented execution for this
	// request.
	// The request will return a CreateTaskResult immediately, and the actual result
	// can be
	// retrieved later via tasks/result.
	//
	// Task augmentation is subject to capability negotiation - receivers MUST declare
	// support
	// for task augmentation of specific request types in their capabilities.
	Task *TaskMetadata `json:"task,omitempty" yaml:"task,omitempty" mapstructure:"task,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 added in v0.8.0

type CallToolRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type CallToolResult

type CallToolResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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"`

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

	// An optional JSON object that represents the structured result of the tool call.
	StructuredContent map[string]interface{} `json:"structuredContent,omitempty" yaml:"structuredContent,omitempty" mapstructure:"structuredContent,omitempty"`
}

The server's response to a tool call.

func (*CallToolResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolResultContentElem

type CallToolResultContentElem interface{}

type CancelTaskRequest added in v0.8.0

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

A request to cancel a task.

func (*CancelTaskRequest) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type CancelTaskRequestParams added in v0.8.0

type CancelTaskRequestParams struct {
	// The task identifier to cancel.
	TaskId string `json:"taskId" yaml:"taskId" mapstructure:"taskId"`
}

func (*CancelTaskRequestParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type CancelTaskResult added in v0.8.0

type CancelTaskResult interface{}

The response to a tasks/cancel request.

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 can be sent by either side to indicate that it is cancelling a previously-issued request.

The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.

This notification indicates that the result will be unused, so any associated processing SHOULD cease.

A client MUST NOT attempt to cancel its `initialize` request.

For task cancellation, use the `tasks/cancel` request instead of this notification.

func (*CancelledNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CancelledNotificationParams

type CancelledNotificationParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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 previously issued in the same
	// direction.
	// This MUST be provided for cancelling non-task requests.
	// This MUST NOT be used for cancelling tasks (use the `tasks/cancel` request
	// instead).
	RequestId *RequestId `json:"requestId,omitempty" yaml:"requestId,omitempty" mapstructure:"requestId,omitempty"`
}

Parameters for a `notifications/cancelled` notification.

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

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

	// Present if the client supports task-augmented requests.
	Tasks *ClientCapabilitiesTasks `json:"tasks,omitempty" yaml:"tasks,omitempty" mapstructure:"tasks,omitempty"`
}

Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.

type ClientCapabilitiesElicitation added in v0.8.0

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

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

Present if the client supports elicitation from the server.

type ClientCapabilitiesRoots

type ClientCapabilitiesRoots struct {
	// Whether the client supports notifications for changes to the roots list.
	ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"`
}

Present if the client supports listing roots.

type ClientCapabilitiesSampling

type ClientCapabilitiesSampling 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 added in v0.8.0

type ClientCapabilitiesTasks struct {
	// Whether this client supports tasks/cancel.
	Cancel map[string]interface{} `json:"cancel,omitempty" yaml:"cancel,omitempty" mapstructure:"cancel,omitempty"`

	// Whether this client supports tasks/list.
	List map[string]interface{} `json:"list,omitempty" yaml:"list,omitempty" mapstructure:"list,omitempty"`

	// Specifies which request types can be augmented with tasks.
	Requests *ClientCapabilitiesTasksRequests `json:"requests,omitempty" yaml:"requests,omitempty" mapstructure:"requests,omitempty"`
}

Present if the client supports task-augmented requests.

type ClientCapabilitiesTasksRequests added in v0.8.0

type ClientCapabilitiesTasksRequests struct {
	// Task support for elicitation-related requests.
	Elicitation *ClientCapabilitiesTasksRequestsElicitation `json:"elicitation,omitempty" yaml:"elicitation,omitempty" mapstructure:"elicitation,omitempty"`

	// Task support for sampling-related requests.
	Sampling *ClientCapabilitiesTasksRequestsSampling `json:"sampling,omitempty" yaml:"sampling,omitempty" mapstructure:"sampling,omitempty"`
}

Specifies which request types can be augmented with tasks.

type ClientCapabilitiesTasksRequestsElicitation added in v0.8.0

type ClientCapabilitiesTasksRequestsElicitation struct {
	// Whether the client supports task-augmented elicitation/create requests.
	Create map[string]interface{} `json:"create,omitempty" yaml:"create,omitempty" mapstructure:"create,omitempty"`
}

Task support for elicitation-related requests.

type ClientCapabilitiesTasksRequestsSampling added in v0.8.0

type ClientCapabilitiesTasksRequestsSampling struct {
	// Whether the client supports task-augmented sampling/createMessage requests.
	CreateMessage map[string]interface{} `json:"createMessage,omitempty" yaml:"createMessage,omitempty" mapstructure:"createMessage,omitempty"`
}

Task support for sampling-related requests.

type ClientNotification

type ClientNotification interface{}

type ClientRequest

type ClientRequest interface{}

type ClientResult

type ClientResult interface{}

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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *CompleteRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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

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

Parameters for a `completion/complete` request.

func (*CompleteRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParamsArgument

type CompleteRequestParamsArgument struct {
	// The name of the argument
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The value of the argument to use for completion matching.
	Value string `json:"value" yaml:"value" mapstructure:"value"`
}

The argument's information

func (*CompleteRequestParamsArgument) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParamsContext added in v0.5.0

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

Additional, optional context for completions

type CompleteRequestParamsMeta added in v0.8.0

type CompleteRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

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

type CompleteResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Completion corresponds to the JSON schema field "completion".
	Completion CompleteResultCompletion `json:"completion" yaml:"completion" mapstructure:"completion"`
}

The server's response to a completion/complete request

func (*CompleteResult) UnmarshalJSON

func (j *CompleteResult) UnmarshalJSON(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 ContentBlock added in v0.5.0

type ContentBlock interface{}

type CreateMessageRequest

type CreateMessageRequest 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 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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *CreateMessageRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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". Values "thisServer" and "allServers" are soft-deprecated.
	// Servers SHOULD only use these values if the client
	// declares ClientCapabilities.sampling.context. These values may be removed in
	// future spec releases.
	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"`

	// If specified, the caller is requesting task-augmented execution for this
	// request.
	// The request will return a CreateTaskResult immediately, and the actual result
	// can be
	// retrieved later via tasks/result.
	//
	// Task augmentation is subject to capability negotiation - receivers MUST declare
	// support
	// for task augmentation of specific request types in their capabilities.
	Task *TaskMetadata `json:"task,omitempty" yaml:"task,omitempty" mapstructure:"task,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
	// 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
	// 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 added in v0.8.0

type CreateMessageRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type CreateMessageResult

type CreateMessageResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 client's response to a sampling/createMessage request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

func (*CreateMessageResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent

type CreateMessageResultContent struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 object.
	//
	// If the tool defined an outputSchema, this SHOULD conform to that schema.
	StructuredContent map[string]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 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_5Elem added in v0.8.0

type CreateMessageResultContent_5Elem interface{}

type CreateTaskResult added in v0.8.0

type CreateTaskResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Task corresponds to the JSON schema field "task".
	Task Task `json:"task" yaml:"task" mapstructure:"task"`
}

A response to a task-augmented request.

func (*CreateTaskResult) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type Cursor

type Cursor string

An opaque token used to represent a cursor for pagination.

type ElicitRequest added in v0.3.6

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

	// ElicitRequestParamsInline corresponds to the JSON schema field "params".
	ElicitRequestParamsInline ElicitRequestElicitRequestParamsInline `json:"params" yaml:"params" mapstructure:"params"`
}

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

func (*ElicitRequest) UnmarshalJSON added in v0.3.6

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestElicitRequestParamsInline added in v0.8.0

type ElicitRequestElicitRequestParamsInline interface{}

type ElicitRequestFormParams added in v0.8.0

type ElicitRequestFormParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *ElicitRequestFormParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

	// If specified, the caller is requesting task-augmented execution for this
	// request.
	// The request will return a CreateTaskResult immediately, and the actual result
	// can be
	// retrieved later via tasks/result.
	//
	// Task augmentation is subject to capability negotiation - receivers MUST declare
	// support
	// for task augmentation of specific request types in their capabilities.
	Task *TaskMetadata `json:"task,omitempty" yaml:"task,omitempty" mapstructure:"task,omitempty"`
}

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

func (*ElicitRequestFormParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestFormParamsMeta added in v0.8.0

type ElicitRequestFormParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type ElicitRequestFormParamsRequestedSchema added in v0.8.0

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

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

	// Required corresponds to the JSON schema field "required".
	Required []string `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"`

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

A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.

func (*ElicitRequestFormParamsRequestedSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParams added in v0.3.6

type ElicitRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *URLElicitRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The ID of the elicitation, which must be unique within the context of the
	// server.
	// The client MUST treat this ID as an opaque value.
	ElicitationId string `json:"elicitationId" yaml:"elicitationId" mapstructure:"elicitationId"`

	// The message to present to the user.
	// For form mode: Describes what information is being requested.
	// For url mode: Explains why the interaction is needed.
	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 ElicitRequestParamsRequestedSchema `json:"requestedSchema,omitempty" yaml:"requestedSchema,omitempty" mapstructure:"requestedSchema,omitempty"`

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

Legacy params for elicitation requests (backward-compat).

type ElicitRequestParamsMode added in v0.5.5

type ElicitRequestParamsMode string

Legacy mode enum for elicitation requests.

const ElicitRequestParamsModeForm ElicitRequestParamsMode = "form"
const ElicitRequestParamsModeUrl ElicitRequestParamsMode = "url"

type ElicitRequestParamsRequestedSchema added in v0.3.6

type ElicitRequestParamsRequestedSchema = ElicitRequestFormParamsRequestedSchema

Backward-compat alias for legacy requested schema.

type ElicitRequestURLParams added in v0.8.0

type ElicitRequestURLParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *ElicitRequestURLParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The ID of the elicitation, which must be unique within the context of the
	// server.
	// The client MUST treat this ID as an opaque value.
	ElicitationId string `json:"elicitationId" yaml:"elicitationId" mapstructure:"elicitationId"`

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

	// If specified, the caller is requesting task-augmented execution for this
	// request.
	// The request will return a CreateTaskResult immediately, and the actual result
	// can be
	// retrieved later via tasks/result.
	//
	// Task augmentation is subject to capability negotiation - receivers MUST declare
	// support
	// for task augmentation of specific request types in their capabilities.
	Task *TaskMetadata `json:"task,omitempty" yaml:"task,omitempty" mapstructure:"task,omitempty"`

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

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

func (*ElicitRequestURLParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestURLParamsMeta added in v0.8.0

type ElicitRequestURLParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type ElicitResult added in v0.3.6

type ElicitResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The user action in response to the elicitation.
	// - "accept": User submitted the form/confirmed the action
	// - "decline": User explicitly decline 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 client's response to an elicitation request.

func (*ElicitResult) UnmarshalJSON added in v0.3.6

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitResultAction added in v0.3.6

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

func (*ElicitResultAction) UnmarshalJSON added in v0.3.6

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationCompleteNotification added in v0.8.0

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

An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.

func (*ElicitationCompleteNotification) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationCompleteNotificationParams added in v0.8.0

type ElicitationCompleteNotificationParams struct {
	// The ID of the elicitation that completed.
	ElicitationId string `json:"elicitationId" yaml:"elicitationId" mapstructure:"elicitationId"`
}

func (*ElicitationCompleteNotificationParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResource

type EmbeddedResource struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

	// Resource corresponds to the JSON schema field "resource".
	Resource EmbeddedResourceResource `json:"resource" yaml:"resource" mapstructure:"resource"`

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

The contents of a resource, embedded into a prompt or tool call result.

It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.

func (*EmbeddedResource) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResourceResource

type EmbeddedResourceResource struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// A base64-encoded string representing the binary data of the item.
	Blob string `json:"blob" yaml:"blob" mapstructure:"blob"`

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

	// The text of the item. This must only be set if the item can actually be
	// represented as text (not binary data).
	Text string `json:"text" yaml:"text" mapstructure:"text"`

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

func (*EmbeddedResourceResource) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type EmptyResult

type EmptyResult struct{}

type EnumSchema added in v0.5.0

type EnumSchema interface{}

type Error

type Error struct {
	// The error type that occurred.
	Code int `json:"code" yaml:"code" mapstructure:"code"`

	// Additional information about the error. The value of this member is defined by
	// the sender (e.g. detailed error information, nested errors etc.).
	Data interface{} `json:"data,omitempty" yaml:"data,omitempty" mapstructure:"data,omitempty"`

	// A short description of the error. The message SHOULD be limited to a concise
	// single sentence.
	Message string `json:"message" yaml:"message" mapstructure:"message"`
}

func (*Error) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequest

type GetPromptRequest struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params GetPromptRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

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

func (*GetPromptRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParams

type GetPromptRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *GetPromptRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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

Parameters for a `prompts/get` request.

func (*GetPromptRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParamsMeta added in v0.8.0

type GetPromptRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type GetPromptResult

type GetPromptResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An optional description for the prompt.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

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

The server's response to a prompts/get request from the client.

func (*GetPromptResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetTaskPayloadRequest added in v0.8.0

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

A request to retrieve the result of a completed task.

func (*GetTaskPayloadRequest) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type GetTaskPayloadRequestParams added in v0.8.0

type GetTaskPayloadRequestParams struct {
	// The task identifier to retrieve results for.
	TaskId string `json:"taskId" yaml:"taskId" mapstructure:"taskId"`
}

func (*GetTaskPayloadRequestParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type GetTaskPayloadResult added in v0.8.0

type GetTaskPayloadResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

The response to a tasks/result request. The structure matches the result type of the original request. For example, a tools/call task would return the CallToolResult structure.

type GetTaskRequest added in v0.8.0

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

A request to retrieve the state of a task.

func (*GetTaskRequest) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type GetTaskRequestParams added in v0.8.0

type GetTaskRequestParams struct {
	// The task identifier to query.
	TaskId string `json:"taskId" yaml:"taskId" mapstructure:"taskId"`
}

func (*GetTaskRequestParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type GetTaskResult added in v0.8.0

type GetTaskResult interface{}

The response to a tasks/get request.

type Icon added in v0.8.0

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

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

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

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

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

func (*Icon) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type IconTheme added in v0.8.0

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

func (*IconTheme) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type Icons added in v0.8.0

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

Base interface to add `icons` property.

type ImageContent

type ImageContent struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 Tool,
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Version corresponds to the JSON schema field "version".
	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 string, version string) *Implementation

func (*Implementation) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequest

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

This request is sent from the client to the server when it first connects, asking it to begin initialization.

func (*InitializeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequestParams

type InitializeRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *InitializeRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Capabilities corresponds to the JSON schema field "capabilities".
	Capabilities ClientCapabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"`

	// ClientInfo corresponds to the JSON schema field "clientInfo".
	ClientInfo Implementation `json:"clientInfo" yaml:"clientInfo" mapstructure:"clientInfo"`

	// The latest version of the Model Context Protocol that the client supports. The
	// client MAY decide to support older versions as well.
	ProtocolVersion string `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"`
}

Parameters for an `initialize` request.

func (*InitializeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequestParamsMeta added in v0.8.0

type InitializeRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type InitializeResult

type InitializeResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// Capabilities corresponds to the JSON schema field "capabilities".
	Capabilities ServerCapabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"`

	// Instructions describing how to use the server and its features.
	//
	// This can be used by clients to improve the LLM's understanding of available
	// tools, resources, etc. It can be thought of like a "hint" to the model. For
	// example, this information MAY be added to the system prompt.
	Instructions *string `json:"instructions,omitempty" yaml:"instructions,omitempty" mapstructure:"instructions,omitempty"`

	// The version of the Model Context Protocol that the server wants to use. This
	// may not match the version that the client requested. If the client cannot
	// support this version, it MUST disconnect.
	ProtocolVersion string `json:"protocolVersion" yaml:"protocolVersion" mapstructure:"protocolVersion"`

	// ServerInfo corresponds to the JSON schema field "serverInfo".
	ServerInfo Implementation `json:"serverInfo" yaml:"serverInfo" mapstructure:"serverInfo"`
}

After receiving an initialize request from the client, the server sends this response.

func (*InitializeResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializedNotification

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

This notification is sent from the client to the server after initialization has finished.

func (*InitializedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCErrorResponse added in v0.8.0

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

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

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

A response to a request that indicates an error occurred.

func (*JSONRPCErrorResponse) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCMessage

type JSONRPCMessage interface{}

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

type JSONRPCNotification

type JSONRPCNotification struct {
	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

A notification which does not expect a response.

func (*JSONRPCNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCRequest

type JSONRPCRequest struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

A request that expects a response.

func (*JSONRPCRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCResponse

type JSONRPCResponse interface{}

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

type JSONRPCResultResponse added in v0.8.0

type JSONRPCResultResponse struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Result corresponds to the JSON schema field "result".
	Result Result `json:"result" yaml:"result" mapstructure:"result"`
}

A successful (non-error) response to a request.

func (*JSONRPCResultResponse) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type LegacyTitledEnumSchema added in v0.8.0

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

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

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

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

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

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

Use TitledSingleSelectEnumSchema instead. This interface will be removed in a future version.

func (*LegacyTitledEnumSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequest

type ListPromptsRequest struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// PaginatedRequestParamsInline corresponds to the JSON schema field "params".
	PaginatedRequestParamsInline *PaginatedRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

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

func (*ListPromptsRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequestParams

type ListPromptsRequestParams = PaginatedRequestParams

type ListPromptsResult

type ListPromptsResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An opaque token representing the pagination position after the last returned
	// result.
	// If present, there may be more results available.
	NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"`

	// Prompts corresponds to the JSON schema field "prompts".
	Prompts []Prompt `json:"prompts" yaml:"prompts" mapstructure:"prompts"`
}

The server's response to a prompts/list request from the client.

func (*ListPromptsResult) UnmarshalJSON

func (j *ListPromptsResult) UnmarshalJSON(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"`

	// PaginatedRequestParamsInline corresponds to the JSON schema field "params".
	PaginatedRequestParamsInline *PaginatedRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

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

func (*ListResourceTemplatesRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesRequestParams

type ListResourceTemplatesRequestParams = PaginatedRequestParams

type ListResourceTemplatesResult

type ListResourceTemplatesResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An opaque token representing the pagination position after the last returned
	// result.
	// If present, there may be more results available.
	NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"`

	// ResourceTemplates corresponds to the JSON schema field "resourceTemplates".
	ResourceTemplates []ResourceTemplate `json:"resourceTemplates" yaml:"resourceTemplates" mapstructure:"resourceTemplates"`
}

The server's response to a resources/templates/list request from the client.

func (*ListResourceTemplatesResult) UnmarshalJSON

func (j *ListResourceTemplatesResult) UnmarshalJSON(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,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An opaque token representing the pagination position after the last returned
	// result.
	// If present, there may be more results available.
	NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"`

	// Resources corresponds to the JSON schema field "resources".
	Resources []Resource `json:"resources" yaml:"resources" mapstructure:"resources"`
}

The server's response to a resources/list request from the client.

func (*ListResourcesResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListRootsRequest

type ListRootsRequest 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,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 = RequestParams

type ListRootsResult

type ListRootsResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

The client's response to a roots/list request from the server. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.

func (*ListRootsResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListTasksRequest added in v0.8.0

type ListTasksRequest 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,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

A request to retrieve a list of tasks.

func (*ListTasksRequest) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ListTasksResult added in v0.8.0

type ListTasksResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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"`

	// Tasks corresponds to the JSON schema field "tasks".
	Tasks []Task `json:"tasks" yaml:"tasks" mapstructure:"tasks"`
}

The response to a tasks/list request.

func (*ListTasksResult) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

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,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An opaque token representing the pagination position after the last returned
	// result.
	// If present, there may be more results available.
	NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"`

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

The server's response to a tools/list request from the client.

func (*ListToolsResult) UnmarshalJSON

func (j *ListToolsResult) UnmarshalJSON(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. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.

func (*LoggingMessageNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotificationParams

type LoggingMessageNotificationParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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 ModelHint

type ModelHint struct {
	// A hint for a model name.
	//
	// The client SHOULD treat this as a substring of a model name; for example:
	//  - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
	//  - `sonnet` should match `claude-3-5-sonnet-20241022`,
	// `claude-3-sonnet-20240229`, etc.
	//  - `claude` should match any Claude model
	//
	// The client MAY also map the string to a different provider's model name or a
	// different model family, as long as it fills a similar niche; for example:
	//  - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
	Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"`
}

Hints to use for model selection.

Keys not declared here are currently left unspecified by the spec and are up to the client to interpret.

type ModelPreferences

type ModelPreferences struct {
	// How much to prioritize cost when selecting a model. A value of 0 means cost
	// is not important, while a value of 1 means cost is the most important
	// factor.
	CostPriority *float64 `json:"costPriority,omitempty" yaml:"costPriority,omitempty" mapstructure:"costPriority,omitempty"`

	// Optional hints to use for model selection.
	//
	// If multiple hints are specified, the client MUST evaluate them in order
	// (such that the first match is taken).
	//
	// The client SHOULD prioritize these hints over the numeric priorities, but
	// MAY still use the priorities to select from ambiguous matches.
	Hints []ModelHint `json:"hints,omitempty" yaml:"hints,omitempty" mapstructure:"hints,omitempty"`

	// How much to prioritize intelligence and capabilities when selecting a
	// model. A value of 0 means intelligence is not important, while a value of 1
	// means intelligence is the most important factor.
	IntelligencePriority *float64 `json:"intelligencePriority,omitempty" yaml:"intelligencePriority,omitempty" mapstructure:"intelligencePriority,omitempty"`

	// How much to prioritize sampling speed (latency) when selecting a model. A
	// value of 0 means speed is not important, while a value of 1 means speed is
	// the most important factor.
	SpeedPriority *float64 `json:"speedPriority,omitempty" yaml:"speedPriority,omitempty" mapstructure:"speedPriority,omitempty"`
}

The server's preferences for model selection, requested of the client during sampling.

Because LLMs can vary along multiple dimensions, choosing the "best" model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This interface allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case.

These preferences are always advisory. The client MAY ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.

func (*ModelPreferences) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type MultiSelectEnumSchema added in v0.8.0

type MultiSelectEnumSchema interface{}

type Notification

type Notification struct {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// RequestParamsInline corresponds to the JSON schema field "params".
	RequestParamsInline 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 NotificationParams

type NotificationParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
}

type NumberSchema added in v0.5.0

type NumberSchema struct {
	// Default corresponds to the JSON schema field "default".
	Default *int `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 *int `json:"maximum,omitempty" yaml:"maximum,omitempty" mapstructure:"maximum,omitempty"`

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

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

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

func (*NumberSchema) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type NumberSchemaType added in v0.5.0

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

func (*NumberSchemaType) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequest

type PaginatedRequest struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params *PaginatedRequestParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

func (*PaginatedRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequestParams

type PaginatedRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *PaginatedRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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 parameters for paginated requests.

type PaginatedRequestParamsMeta added in v0.8.0

type PaginatedRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type PaginatedResult

type PaginatedResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// An opaque token representing the pagination position after the last returned
	// result.
	// If present, there may be more results available.
	NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty" mapstructure:"nextCursor,omitempty"`
}

type PingRequest

type PingRequest 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,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.

func (*PingRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PingRequestParams

type PingRequestParams = RequestParams

Backward-compat aliases for legacy request param names.

type PingResult

type PingResult EmptyResult

type PrimitiveSchemaDefinition added in v0.5.0

type PrimitiveSchemaDefinition interface{}

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

type ProgressNotification

type ProgressNotification struct {
	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params ProgressNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

An out-of-band notification used to inform the receiver of a progress update for a long-running request.

func (*ProgressNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ProgressNotificationParams

type ProgressNotificationParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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 `notifications/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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 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 may be issued by servers without any previous subscription from the client.

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 `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 Tool,
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

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

Identifies a prompt.

func (*PromptReference) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequest

type ReadResourceRequest struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params ReadResourceRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

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

func (*ReadResourceRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceRequestParams

type ReadResourceRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *ReadResourceRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,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 added in v0.8.0

type ReadResourceRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type ReadResourceResult

type ReadResourceResult struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

The server's response to a resources/read request from the client.

func (*ReadResourceResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultContentsElem

type ReadResourceResultContentsElem struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 RelatedTaskMetadata added in v0.8.0

type RelatedTaskMetadata struct {
	// The task identifier this message is associated with.
	TaskId string `json:"taskId" yaml:"taskId" mapstructure:"taskId"`
}

Metadata for associating messages with a task. Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.

func (*RelatedTaskMetadata) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type Request

type Request struct {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// RequestParamsInline corresponds to the JSON schema field "params".
	RequestParamsInline 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 RequestParams

type RequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *RequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`
}

Common params for any request.

type RequestParamsMeta

type RequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type Resource

type Resource struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 `resources/list` requests.

func (*ResourceLink) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotification

type ResourceListChangedNotification struct {
	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params *NotificationParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.

func (*ResourceListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceRequestParams added in v0.8.0

type ResourceRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *ResourceRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,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"`
}

Common parameters when working with resources.

func (*ResourceRequestParams) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceRequestParamsMeta added in v0.8.0

type ResourceRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type ResourceTemplate

type ResourceTemplate struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 Tool,
	// where `annotations.title` should be given precedence over using `name`,
	// if present).
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// A URI template (according to RFC 6570) that can be used to construct resource
	// URIs.
	UriTemplate string `json:"uriTemplate" yaml:"uriTemplate" mapstructure:"uriTemplate"`
}

A template description for resources available on the server.

func (*ResourceTemplate) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceTemplateReference added in v0.5.0

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

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

A reference to a resource or resource template definition.

func (*ResourceTemplateReference) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotification

type ResourceUpdatedNotification struct {
	// Jsonrpc corresponds to the JSON schema field "jsonrpc".
	Jsonrpc string `json:"jsonrpc" yaml:"jsonrpc" mapstructure:"jsonrpc"`

	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

	// Params corresponds to the JSON schema field "params".
	Params ResourceUpdatedNotificationParams `json:"params" yaml:"params" mapstructure:"params"`
}

A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.

func (*ResourceUpdatedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotificationParams

type ResourceUpdatedNotificationParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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

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

A notification from the client to the server, informing it that the list of roots has changed. This notification should be sent whenever the client adds, removes, or modifies any root. The server should then request an updated list of roots using the ListRootsRequest.

func (*RootsListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessage

type SamplingMessage struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 object.
	//
	// If the tool defined an outputSchema, this SHOULD conform to that schema.
	StructuredContent map[string]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 ToolUseContent.
	ToolUseId string `json:"toolUseId" yaml:"toolUseId" mapstructure:"toolUseId"`

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

Text provided to or from an LLM.

func (*SamplingMessageContent) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContentBlock added in v0.8.0

type SamplingMessageContentBlock interface{}

type SamplingMessageContent_5Elem added in v0.8.0

type SamplingMessageContent_5Elem interface{}

type ServerCapabilities

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

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

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

	// Present if the server supports task-augmented requests.
	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 added in v0.8.0

type ServerCapabilitiesTasks struct {
	// Whether this server supports tasks/cancel.
	Cancel map[string]interface{} `json:"cancel,omitempty" yaml:"cancel,omitempty" mapstructure:"cancel,omitempty"`

	// Whether this server supports tasks/list.
	List map[string]interface{} `json:"list,omitempty" yaml:"list,omitempty" mapstructure:"list,omitempty"`

	// Specifies which request types can be augmented with tasks.
	Requests *ServerCapabilitiesTasksRequests `json:"requests,omitempty" yaml:"requests,omitempty" mapstructure:"requests,omitempty"`
}

Present if the server supports task-augmented requests.

type ServerCapabilitiesTasksRequests added in v0.8.0

type ServerCapabilitiesTasksRequests struct {
	// Task support for tool-related requests.
	Tools *ServerCapabilitiesTasksRequestsTools `json:"tools,omitempty" yaml:"tools,omitempty" mapstructure:"tools,omitempty"`
}

Specifies which request types can be augmented with tasks.

type ServerCapabilitiesTasksRequestsTools added in v0.8.0

type ServerCapabilitiesTasksRequestsTools struct {
	// Whether the server supports task-augmented tools/call requests.
	Call map[string]interface{} `json:"call,omitempty" yaml:"call,omitempty" mapstructure:"call,omitempty"`
}

Task support for tool-related requests.

type ServerCapabilitiesTools

type ServerCapabilitiesTools struct {
	// Whether this server supports notifications for changes to the tool list.
	ListChanged *bool `json:"listChanged,omitempty" yaml:"listChanged,omitempty" mapstructure:"listChanged,omitempty"`
}

Present if the server offers any tools to call.

type ServerNotification

type ServerNotification interface{}

type ServerRequest

type ServerRequest interface{}

type ServerResult

type ServerResult interface{}

type SetLevelRequest

type SetLevelRequest struct {
	// 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 SetLevelRequestParams `json:"params" yaml:"params" mapstructure:"params"`
}

A request from the client to the server, to enable or adjust logging.

func (*SetLevelRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SetLevelRequestParams

type SetLevelRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *SetLevelRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// The level of logging that the client wants to receive from the server. The
	// server should send all logs at this level and higher (i.e., more severe) to the
	// client as notifications/message.
	Level LoggingLevel `json:"level" yaml:"level" mapstructure:"level"`
}

Parameters for a `logging/setLevel` request.

func (*SetLevelRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SetLevelRequestParamsMeta added in v0.8.0

type SetLevelRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type SetLevelResult

type SetLevelResult EmptyResult

type SingleSelectEnumSchema added in v0.8.0

type SingleSelectEnumSchema interface{}

type StringSchema added in v0.5.0

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

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

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

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

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

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

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

func (*StringSchema) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type StringSchemaFormat added in v0.5.0

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

func (*StringSchemaFormat) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements json.Unmarshaler.

type StructToPropertiesOption added in v0.3.6

type StructToPropertiesOption func(*structToPropertiesOptions)

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

func WithDescriptionHook added in v0.5.0

func WithDescriptionHook(description string) StructToPropertiesOption

WithDescriptionHook create description hook option

func WithFormatHook added in v0.3.6

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

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

func WithIsRequiredHook added in v0.3.6

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

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

func WithNullableHook added in v0.3.6

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

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

func WithSkipFieldHook added in v0.3.6

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

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

type SubscribeRequest

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

Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.

func (*SubscribeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequestParams

type SubscribeRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *SubscribeRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,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/subscribe` request.

func (*SubscribeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequestParamsMeta added in v0.8.0

type SubscribeRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type SubscribeResult

type SubscribeResult EmptyResult

type Task added in v0.8.0

type Task struct {
	// ISO 8601 timestamp when the task was created.
	CreatedAt string `json:"createdAt" yaml:"createdAt" mapstructure:"createdAt"`

	// ISO 8601 timestamp when the task was last updated.
	LastUpdatedAt string `json:"lastUpdatedAt" yaml:"lastUpdatedAt" mapstructure:"lastUpdatedAt"`

	// Suggested polling interval in milliseconds.
	PollInterval *int `json:"pollInterval,omitempty" yaml:"pollInterval,omitempty" mapstructure:"pollInterval,omitempty"`

	// Current task state.
	Status TaskStatus `json:"status" yaml:"status" mapstructure:"status"`

	// Optional human-readable message describing the current task state.
	// This can provide context for any status, including:
	// - Reasons for "cancelled" status
	// - Summaries for "completed" status
	// - Diagnostic information for "failed" status (e.g., error details, what went
	// wrong)
	StatusMessage *string `json:"statusMessage,omitempty" yaml:"statusMessage,omitempty" mapstructure:"statusMessage,omitempty"`

	// The task identifier.
	TaskId string `json:"taskId" yaml:"taskId" mapstructure:"taskId"`

	// Actual retention duration from creation in milliseconds, null for unlimited.
	Ttl int `json:"ttl" yaml:"ttl" mapstructure:"ttl"`
}

Data associated with a task.

func (*Task) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TaskAugmentedRequestParams added in v0.8.0

type TaskAugmentedRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *TaskAugmentedRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// If specified, the caller is requesting task-augmented execution for this
	// request.
	// The request will return a CreateTaskResult immediately, and the actual result
	// can be
	// retrieved later via tasks/result.
	//
	// Task augmentation is subject to capability negotiation - receivers MUST declare
	// support
	// for task augmentation of specific request types in their capabilities.
	Task *TaskMetadata `json:"task,omitempty" yaml:"task,omitempty" mapstructure:"task,omitempty"`
}

Common params for any task-augmented request.

type TaskAugmentedRequestParamsMeta added in v0.8.0

type TaskAugmentedRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type TaskMetadata added in v0.8.0

type TaskMetadata struct {
	// Requested duration in milliseconds to retain task from creation.
	Ttl *int `json:"ttl,omitempty" yaml:"ttl,omitempty" mapstructure:"ttl,omitempty"`
}

Metadata for augmenting a request with task execution. Include this in the `task` field of the request parameters.

type TaskStatus added in v0.8.0

type TaskStatus string
const TaskStatusCancelled TaskStatus = "cancelled"
const TaskStatusCompleted TaskStatus = "completed"
const TaskStatusFailed TaskStatus = "failed"
const TaskStatusInputRequired TaskStatus = "input_required"
const TaskStatusWorking TaskStatus = "working"

func (*TaskStatus) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TaskStatusNotification added in v0.8.0

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

	// TaskStatusNotificationParamsInline corresponds to the JSON schema field
	// "params".
	TaskStatusNotificationParamsInline TaskStatusNotificationTaskStatusNotificationParamsInline `json:"params" yaml:"params" mapstructure:"params"`
}

An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.

func (*TaskStatusNotification) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TaskStatusNotificationParams added in v0.8.0

type TaskStatusNotificationParams interface{}

Parameters for a `notifications/tasks/status` notification.

type TaskStatusNotificationTaskStatusNotificationParamsInline added in v0.8.0

type TaskStatusNotificationTaskStatusNotificationParamsInline interface{}

type TextContent

type TextContent struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

	// The text of the item. This must only be set if the item can actually be
	// represented as text (not binary data).
	Text string `json:"text" yaml:"text" mapstructure:"text"`

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

func (*TextResourceContents) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchema added in v0.8.0

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

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

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

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

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

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

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

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

func (*TitledMultiSelectEnumSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItems added in v0.8.0

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

Schema for array items with enum options and display labels.

func (*TitledMultiSelectEnumSchemaItems) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TitledMultiSelectEnumSchemaItemsAnyOfElem added in v0.8.0

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

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

func (*TitledMultiSelectEnumSchemaItemsAnyOfElem) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchema added in v0.8.0

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

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

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

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

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

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

func (*TitledSingleSelectEnumSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type TitledSingleSelectEnumSchemaOneOfElem added in v0.8.0

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

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

func (*TitledSingleSelectEnumSchemaOneOfElem) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type Tool

type Tool struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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"`

	// Execution-related properties for this tool.
	Execution *ToolExecution `json:"execution,omitempty" yaml:"execution,omitempty" mapstructure:"execution,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.
	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 CallToolResult.
	//
	// Defaults to JSON Schema 2020-12 when no explicit $schema is provided.
	// Currently restricted to type: "object" at the root level.
	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 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 Tool to clients.

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

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

type ToolChoice added in v0.8.0

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

Controls tool selection behavior for sampling requests.

type ToolChoiceMode added in v0.8.0

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

func (*ToolChoiceMode) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ToolExecution added in v0.8.0

type ToolExecution struct {
	// Indicates whether this tool supports task-augmented execution.
	// This allows clients to handle long-running operations through polling
	// the task system.
	//
	// - "forbidden": Tool does not support task-augmented execution (default when
	// absent)
	// - "optional": Tool may support task-augmented execution
	// - "required": Tool requires task-augmented execution
	//
	// Default: "forbidden"
	TaskSupport *ToolExecutionTaskSupport `json:"taskSupport,omitempty" yaml:"taskSupport,omitempty" mapstructure:"taskSupport,omitempty"`
}

Execution-related properties for a tool.

type ToolExecutionTaskSupport added in v0.8.0

type ToolExecutionTaskSupport string
const ToolExecutionTaskSupportForbidden ToolExecutionTaskSupport = "forbidden"
const ToolExecutionTaskSupportOptional ToolExecutionTaskSupport = "optional"
const ToolExecutionTaskSupportRequired ToolExecutionTaskSupport = "required"

func (*ToolExecutionTaskSupport) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

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 corresponds to the JSON schema field "properties".
	Properties map[string]map[string]interface{} `json:"properties,omitempty" yaml:"properties,omitempty" mapstructure:"properties,omitempty"`

	// Required corresponds to the JSON schema field "required".
	Required []string `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"`

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

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

func (*ToolInputSchema) Load

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

func (*ToolInputSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolInputSchemaProperties

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

ToolInputSchemaProperties represents the properties map for a tool input schema.

func StructToProperties added in v0.3.6

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

StructToProperties converts a struct type into MCP InputSchema properties and required fields. 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 may be issued by servers without any previous subscription from the client.

func (*ToolListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolOutputSchema added in v0.3.6

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

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

	// Required corresponds to the JSON schema field "required".
	Required []string `json:"required,omitempty" yaml:"required,omitempty" mapstructure:"required,omitempty"`

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

An optional JSON Schema object defining the structure of the tool's output returned in the structuredContent field of a CallToolResult.

Defaults to JSON Schema 2020-12 when no explicit $schema is provided. Currently restricted to type: "object" at the root level.

func (*ToolOutputSchema) Load added in v0.3.12

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

func (*ToolOutputSchema) UnmarshalJSON added in v0.3.6

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

UnmarshalJSON implements json.Unmarshaler.

type ToolResultContent added in v0.8.0

type ToolResultContent struct {
	// Optional metadata about the tool result. Clients SHOULD preserve this field
	// when
	// including tool results in subsequent sampling requests to enable caching
	// optimizations.
	//
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	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 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 object.
	//
	// If the tool defined an outputSchema, this SHOULD conform to that schema.
	StructuredContent map[string]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 ToolUseContent.
	ToolUseId string `json:"toolUseId" yaml:"toolUseId" mapstructure:"toolUseId"`

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

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

func (*ToolResultContent) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type ToolResultContentContentElem added in v0.8.0

type ToolResultContentContentElem interface{}

type ToolUseContent added in v0.8.0

type ToolUseContent struct {
	// Optional metadata about the tool use. Clients SHOULD preserve this field when
	// including tool uses in subsequent sampling requests to enable caching
	// optimizations.
	//
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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

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

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

A request from the assistant to call a tool.

func (*ToolUseContent) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitRequestParamsMeta added in v0.5.5

type URLElicitRequestParamsMeta = ElicitRequestURLParamsMeta

Backward-compat alias for legacy meta name.

type URLElicitationRequiredError added in v0.8.0

type URLElicitationRequiredError struct {
	// Error corresponds to the JSON schema field "error".
	Error URLElicitationRequiredErrorError `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"`
}

An error response that indicates that the server requires the client to provide additional information via an elicitation request.

func (*URLElicitationRequiredError) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitationRequiredErrorError added in v0.8.0

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

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitationRequiredErrorErrorData added in v0.8.0

type URLElicitationRequiredErrorErrorData struct {
	// Elicitations corresponds to the JSON schema field "elicitations".
	Elicitations []ElicitRequestURLParams `json:"elicitations" yaml:"elicitations" mapstructure:"elicitations"`

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

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

func (*URLElicitationRequiredErrorErrorData) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type UnsubscribeRequest

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

Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.

func (*UnsubscribeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type UnsubscribeRequestParams

type UnsubscribeRequestParams struct {
	// See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for
	// notes on `_meta` usage.
	Meta *UnsubscribeRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,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/unsubscribe` request.

func (*UnsubscribeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type UnsubscribeRequestParamsMeta added in v0.8.0

type UnsubscribeRequestParamsMeta struct {
	// If specified, the caller is requesting out-of-band progress notifications for
	// this request (as represented by notifications/progress). The value of this
	// parameter is an opaque token that will be attached to any subsequent
	// notifications. The receiver is not obligated to provide these notifications.
	ProgressToken *ProgressToken `json:"progressToken,omitempty" yaml:"progressToken,omitempty" mapstructure:"progressToken,omitempty"`

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

See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.

type UnsubscribeResult

type UnsubscribeResult EmptyResult

type UntitledMultiSelectEnumSchema added in v0.8.0

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

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

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

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

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

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

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

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

func (*UntitledMultiSelectEnumSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type UntitledMultiSelectEnumSchemaItems added in v0.8.0

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

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

Schema for the array items.

func (*UntitledMultiSelectEnumSchemaItems) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

type UntitledSingleSelectEnumSchema added in v0.8.0

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

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

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

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

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

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

func (*UntitledSingleSelectEnumSchema) UnmarshalJSON added in v0.8.0

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

UnmarshalJSON implements json.Unmarshaler.

Directories

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

Jump to

Keyboard shortcuts

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