schema

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schema (draft) contains experimental code generated from a draft version of the Model Context Protocol JSON schema. Consumers should treat everything under `schema/draft` as volatile – field names, types and semantics may change without notice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

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

	// 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 [specification/draft/basic/index#general-fields] 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.5

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.5

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

UnmarshalJSON implements json.Unmarshaler.

type BlobResourceContents

type BlobResourceContents struct {
	// See [specification/draft/basic/index#general-fields] 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

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

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

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

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

func (*BooleanSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequest

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

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

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

func (*CallToolRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolRequestParams

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

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

func (*CallToolRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CallToolResult

type CallToolResult struct {
	// See [specification/draft/basic/index#general-fields] 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 CancelledNotification

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

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

This notification can be sent by either side to indicate that it is cancelling a previously-issued request.

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

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

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

func (*CancelledNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CancelledNotificationParams

type CancelledNotificationParams struct {
	// An optional string describing the reason for the cancellation. This MAY be
	// logged or presented to the user.
	Reason *string `json:"reason,omitempty" yaml:"reason,omitempty" mapstructure:"reason,omitempty"`

	// The ID of the request to cancel.
	//
	// This MUST correspond to the ID of a request previously issued in the same
	// direction.
	RequestId RequestId `json:"requestId" yaml:"requestId" mapstructure:"requestId"`
}

func (*CancelledNotificationParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ClientCapabilities

type ClientCapabilities struct {
	// Present if the client supports elicitation from the server.
	Elicitation interface{} `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 map[string]interface{} `json:"sampling,omitempty" yaml:"sampling,omitempty" mapstructure:"sampling,omitempty"`
}

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

type ClientCapabilitiesElicitation_0 added in v0.5.5

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

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

func (*ClientCapabilitiesElicitation_0) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type ClientCapabilitiesElicitation_1 added in v0.5.5

type ClientCapabilitiesElicitation_1 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" yaml:"url" mapstructure:"url"`
}

func (*ClientCapabilitiesElicitation_1) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

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 ClientNotification

type ClientNotification interface{}

type ClientRequest

type ClientRequest interface{}

type ClientResult

type ClientResult interface{}

type CompleteRequest

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

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

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

func (*CompleteRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CompleteRequestParams

type CompleteRequestParams struct {
	// 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"`
}

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.5

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

type CompleteRequestParamsRef_0 = PromptReference

type CompleteRequestParamsRef_1

type CompleteRequestParamsRef_1 = ResourceTemplateReference

type CompleteResult

type CompleteResult struct {
	// See [specification/draft/basic/index#general-fields] 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.5

type ContentBlock interface{}

type CreateMessageRequest

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

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

A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.

func (*CreateMessageRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageRequestParams

type CreateMessageRequestParams struct {
	// A request to include context from one or more MCP servers (including the
	// caller), to be attached to the prompt. The client MAY ignore this request.
	IncludeContext *CreateMessageRequestParamsIncludeContext `json:"includeContext,omitempty" yaml:"includeContext,omitempty" mapstructure:"includeContext,omitempty"`

	// The maximum number of tokens to sample, as requested by the server. The client
	// MAY choose to sample fewer tokens than requested.
	MaxTokens int `json:"maxTokens" yaml:"maxTokens" mapstructure:"maxTokens"`

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

	// Optional metadata to pass through to the LLM provider. The format of this
	// metadata is provider-specific.
	Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// The server's preferences for which model to select. The client MAY ignore these
	// preferences.
	ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty" yaml:"modelPreferences,omitempty" mapstructure:"modelPreferences,omitempty"`

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

	// An optional system prompt the server wants to use for sampling. The client MAY
	// modify or omit this prompt.
	SystemPrompt *string `json:"systemPrompt,omitempty" yaml:"systemPrompt,omitempty" mapstructure:"systemPrompt,omitempty"`

	// Temperature corresponds to the JSON schema field "temperature".
	Temperature *float64 `json:"temperature,omitempty" yaml:"temperature,omitempty" mapstructure:"temperature,omitempty"`
}

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 CreateMessageResult

type CreateMessageResult struct {
	// See [specification/draft/basic/index#general-fields] 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.
	StopReason *string `json:"stopReason,omitempty" yaml:"stopReason,omitempty" mapstructure:"stopReason,omitempty"`
}

The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

func (*CreateMessageResult) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent

type CreateMessageResultContent struct {
	// See [specification/draft/basic/index#general-fields] 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"`

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

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

UnmarshalJSON implements json.Unmarshaler.

type CreateMessageResultContent_0

type CreateMessageResultContent_0 = TextContent

type CreateMessageResultContent_1

type CreateMessageResultContent_1 = ImageContent

type CreateMessageResultContent_2

type CreateMessageResultContent_2 = AudioContent

type Cursor

type Cursor string

An opaque token used to represent a cursor for pagination.

type ElicitRequest

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

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

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

func (*ElicitRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParams

type ElicitRequestParams struct {
	// See [specification/draft/basic/index#general-fields] 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" yaml:"mode" mapstructure:"mode"`

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

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

func (*ElicitRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParamsMeta added in v0.5.5

type ElicitRequestParamsMeta 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 [specification/draft/basic/index#general-fields] for notes on _meta usage.

type ElicitRequestParamsMode added in v0.5.5

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

func (*ElicitRequestParamsMode) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitRequestParams_0 added in v0.5.5

type ElicitRequestParams_0 = URLElicitRequestParams

type ElicitRequestParams_1 added in v0.5.5

type ElicitRequestParams_1 = FormElicitRequestParams

type ElicitResult

type ElicitResult struct {
	// See [specification/draft/basic/index#general-fields] 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

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitResultAction

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

func (*ElicitResultAction) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationRequiredError added in v0.5.5

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

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

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

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

func (*ElicitationRequiredError) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationRequiredErrorError added in v0.5.5

type ElicitationRequiredErrorError struct {
	// Code corresponds to the JSON schema field "code".
	Code int `json:"code" yaml:"code" mapstructure:"code"`

	// Data corresponds to the JSON schema field "data".
	Data ElicitationRequiredErrorErrorData `json:"data" yaml:"data" mapstructure:"data"`

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

func (*ElicitationRequiredErrorError) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type ElicitationRequiredErrorErrorData added in v0.5.5

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

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

func (*ElicitationRequiredErrorErrorData) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResource

type EmbeddedResource struct {
	// See [specification/draft/basic/index#general-fields] 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 [specification/draft/basic/index#general-fields] 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,omitempty" yaml:"blob" mapstructure:"blob"`

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

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

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

func (*EmbeddedResourceResource) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type EmbeddedResourceResource_0

type EmbeddedResourceResource_0 = TextResourceContents

type EmbeddedResourceResource_1

type EmbeddedResourceResource_1 = BlobResourceContents

type EnumSchema

type EnumSchema struct {
	// 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"`

	// EnumNames corresponds to the JSON schema field "enumNames".
	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"`
}

func (*EnumSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type FormElicitRequestParams added in v0.5.5

type FormElicitRequestParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta *FormElicitRequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

	// 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" yaml:"mode" mapstructure:"mode"`

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

func (*FormElicitRequestParams) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type FormElicitRequestParamsMeta added in v0.5.5

type FormElicitRequestParamsMeta 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 [specification/draft/basic/index#general-fields] for notes on _meta usage.

type FormElicitRequestParamsRequestedSchema added in v0.5.5

type FormElicitRequestParamsRequestedSchema struct {
	// 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 (*FormElicitRequestParamsRequestedSchema) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequest

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

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

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

func (*GetPromptRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptRequestParams

type GetPromptRequestParams struct {
	// 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"`
}

func (*GetPromptRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type GetPromptResult

type GetPromptResult struct {
	// See [specification/draft/basic/index#general-fields] 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 ImageContent

type ImageContent struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// 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"`
}

Describes the name and version of an MCP implementation, with an optional title for UI representation.

func (*Implementation) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequest

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

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

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

func (*InitializeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeRequestParams

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

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

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

func (*InitializeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializeResult

type InitializeResult struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

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

func (*InitializedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type InitializedNotificationParams

type InitializedNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type JSONRPCError

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

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

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

A response to a request that indicates an error occurred.

func (*JSONRPCError) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCErrorError

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

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

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

func (*JSONRPCErrorError) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCMessage

type JSONRPCMessage interface{}

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

type JSONRPCNotification

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

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

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

A notification which does not expect a response.

func (*JSONRPCNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type JSONRPCNotificationParams

type JSONRPCNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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 *RequestParams `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 struct {
	// Id corresponds to the JSON schema field "id".
	Id RequestId `json:"id" yaml:"id" mapstructure:"id"`

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

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

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

func (*JSONRPCResponse) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequest

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

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

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

func (*ListPromptsRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListPromptsRequestParams

type ListPromptsRequestParams struct {
	// An opaque token representing the current pagination position.
	// If provided, the server should return results starting after this cursor.
	Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"`
}

type ListPromptsResult

type ListPromptsResult struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

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

func (*ListResourceTemplatesRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourceTemplatesRequestParams

type ListResourceTemplatesRequestParams struct {
	// An opaque token representing the current pagination position.
	// If provided, the server should return results starting after this cursor.
	Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"`
}

type ListResourceTemplatesResult

type ListResourceTemplatesResult struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

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

func (*ListResourcesRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListResourcesRequestParams

type ListResourcesRequestParams struct {
	// An opaque token representing the current pagination position.
	// If provided, the server should return results starting after this cursor.
	Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"`
}

type ListResourcesResult

type ListResourcesResult struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// 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 ListRootsResult

type ListRootsResult struct {
	// See [specification/draft/basic/index#general-fields] 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 ListToolsRequest

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

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

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

func (*ListToolsRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ListToolsRequestParams

type ListToolsRequestParams struct {
	// An opaque token representing the current pagination position.
	// If provided, the server should return results starting after this cursor.
	Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"`
}

type ListToolsResult

type ListToolsResult struct {
	// See [specification/draft/basic/index#general-fields] 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 LoggingLevelAlert LoggingLevel = "alert"
const LoggingLevelCritical LoggingLevel = "critical"
const LoggingLevelDebug LoggingLevel = "debug"
const LoggingLevelEmergency LoggingLevel = "emergency"
const LoggingLevelError LoggingLevel = "error"
const LoggingLevelInfo LoggingLevel = "info"
const LoggingLevelNotice LoggingLevel = "notice"
const LoggingLevelWarning LoggingLevel = "warning"

func (*LoggingLevel) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotification

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

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

Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.

func (*LoggingMessageNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type LoggingMessageNotificationParams

type LoggingMessageNotificationParams struct {
	// The data to be logged, such as a string message or an object. Any JSON
	// serializable type is allowed here.
	Data interface{} `json:"data" yaml:"data" mapstructure:"data"`

	// The severity of this log message.
	Level LoggingLevel `json:"level" yaml:"level" mapstructure:"level"`

	// An optional name of the logger issuing this message.
	Logger *string `json:"logger,omitempty" yaml:"logger,omitempty" mapstructure:"logger,omitempty"`
}

func (*LoggingMessageNotificationParams) UnmarshalJSON

func (j *LoggingMessageNotificationParams) UnmarshalJSON(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 Notification

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

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

func (*Notification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type NotificationParams

type NotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type NumberSchema

type NumberSchema struct {
	// 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

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

UnmarshalJSON implements json.Unmarshaler.

type NumberSchemaType

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

func (*NumberSchemaType) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PaginatedRequest

type PaginatedRequest struct {
	// 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 {
	// An opaque token representing the current pagination position.
	// If provided, the server should return results starting after this cursor.
	Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty" mapstructure:"cursor,omitempty"`
}

type PaginatedResult

type PaginatedResult struct {
	// See [specification/draft/basic/index#general-fields] 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 {
	// 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 PrimitiveSchemaDefinition

type PrimitiveSchemaDefinition interface{}

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

type ProgressNotification

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

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

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

func (*ProgressNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ProgressNotificationParams

type ProgressNotificationParams struct {
	// 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"`
}

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 [specification/draft/basic/index#general-fields] 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"`

	// 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 {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

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

func (*PromptListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type PromptListChangedNotificationParams

type PromptListChangedNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

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 {
	// 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 {
	// The URI of the resource to read. The URI can use any protocol; it is up to the
	// server how to interpret it.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

func (*ReadResourceRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResult

type ReadResourceResult struct {
	// See [specification/draft/basic/index#general-fields] 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 [specification/draft/basic/index#general-fields] 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,omitempty" 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,omitempty" yaml:"text" mapstructure:"text"`

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

func (*ReadResourceResultContentsElem) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ReadResourceResultContentsElem_0

type ReadResourceResultContentsElem_0 = TextResourceContents

type ReadResourceResultContentsElem_1

type ReadResourceResultContentsElem_1 = BlobResourceContents

type Request

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

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

func (*Request) UnmarshalJSON

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 [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta *RequestParamsMeta `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type RequestParamsMeta

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

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

See [specification/draft/basic/index#general-fields] for notes on _meta usage.

type Resource

type Resource struct {
	// See [specification/draft/basic/index#general-fields] 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"`

	// 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 [specification/draft/basic/index#general-fields] 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 [specification/draft/basic/index#general-fields] 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"`

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

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotification

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

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

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

func (*ResourceListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceListChangedNotificationParams

type ResourceListChangedNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type ResourceTemplate

type ResourceTemplate struct {
	// See [specification/draft/basic/index#general-fields] 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"`

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

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.5

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotification

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

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

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

func (*ResourceUpdatedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ResourceUpdatedNotificationParams

type ResourceUpdatedNotificationParams struct {
	// The URI of the resource that has been updated. This might be a sub-resource of
	// the one that the client actually subscribed to.
	Uri string `json:"uri" yaml:"uri" mapstructure:"uri"`
}

func (*ResourceUpdatedNotificationParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type Result

type Result struct {
	// See [specification/draft/basic/index#general-fields] 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 [specification/draft/basic/index#general-fields] 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 {
	// Method corresponds to the JSON schema field "method".
	Method string `json:"method" yaml:"method" mapstructure:"method"`

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

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

func (*RootsListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type RootsListChangedNotificationParams

type RootsListChangedNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type SamplingMessage

type SamplingMessage struct {
	// 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 [specification/draft/basic/index#general-fields] 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"`

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

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

UnmarshalJSON implements json.Unmarshaler.

type SamplingMessageContent_0

type SamplingMessageContent_0 = TextContent

type SamplingMessageContent_1

type SamplingMessageContent_1 = ImageContent

type SamplingMessageContent_2

type SamplingMessageContent_2 = AudioContent

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

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

Present if the server offers any tools to call.

type ServerNotification

type ServerNotification interface{}

type ServerRequest

type ServerRequest interface{}

type ServerResult

type ServerResult interface{}

type SetLevelRequest

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

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

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

func (*SetLevelRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SetLevelRequestParams

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

func (*SetLevelRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type StringSchema

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

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

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

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

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

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

func (*StringSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type StringSchemaFormat

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

func (*StringSchemaFormat) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequest

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

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

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

func (*SubscribeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type SubscribeRequestParams

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

func (*SubscribeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type TextContent

type TextContent struct {
	// See [specification/draft/basic/index#general-fields] 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 [specification/draft/basic/index#general-fields] 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 Tool

type Tool struct {
	// See [specification/draft/basic/index#general-fields] 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"`

	// 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.
	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 the 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 ToolInputSchema

type ToolInputSchema struct {
	// 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) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolListChangedNotification

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

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

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

func (*ToolListChangedNotification) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type ToolListChangedNotificationParams

type ToolListChangedNotificationParams struct {
	// See [specification/draft/basic/index#general-fields] for notes on _meta usage.
	Meta map[string]interface{} `json:"_meta,omitempty" yaml:"_meta,omitempty" mapstructure:"_meta,omitempty"`

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

type ToolOutputSchema

type ToolOutputSchema struct {
	// 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.

func (*ToolOutputSchema) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitRequestParams added in v0.5.5

type URLElicitRequestParams struct {
	// See [specification/draft/basic/index#general-fields] 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" yaml:"mode" mapstructure:"mode"`

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

func (*URLElicitRequestParams) UnmarshalJSON added in v0.5.5

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

UnmarshalJSON implements json.Unmarshaler.

type URLElicitRequestParamsMeta added in v0.5.5

type URLElicitRequestParamsMeta 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 [specification/draft/basic/index#general-fields] for notes on _meta usage.

type UnsubscribeRequest

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

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

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

func (*UnsubscribeRequest) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

type UnsubscribeRequestParams

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

func (*UnsubscribeRequestParams) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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