Documentation
¶
Index ¶
Constants ¶
const ( // SERVER_NAME is the server name used in Implementation. SERVER_NAME = "Toolbox" // methods that are supported INITIALIZE = "initialize" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMetadata ¶ added in v0.10.0
type BaseMetadata struct {
// Intended for programmatic or logical use, but used as a display name in past specs
// or fallback (if title isn't present).
Name string `json:"name"`
// 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"`
}
Base interface for metadata with name (identifier) and title (display name) properties.
type ClientCapabilities ¶
type ClientCapabilities struct {
// Experimental, non-standard capabilities that the client supports.
Experimental map[string]interface{} `json:"experimental,omitempty"`
// Present if the client supports listing roots.
Roots *ListChanged `json:"roots,omitempty"`
// Present if the client supports sampling from an LLM.
Sampling struct{} `json:"sampling,omitempty"`
}
ClientCapabilities represents 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 Implementation ¶
type Implementation struct {
BaseMetadata
Version string `json:"version"`
}
Implementation describes the name and version of an MCP implementation.
type InitializeParams ¶
type InitializeParams struct {
// 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"`
Capabilities ClientCapabilities `json:"capabilities"`
ClientInfo Implementation `json:"clientInfo"`
}
Params to define MCP Client during initialize request.
type InitializeRequest ¶
type InitializeRequest struct {
jsonrpc.Request
Params InitializeParams `json:"params"`
}
InitializeRequest is sent from the client to the server when it first connects, asking it to begin initialization.
type InitializeResult ¶
type InitializeResult struct {
jsonrpc.Result
// 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"`
Capabilities ServerCapabilities `json:"capabilities"`
ServerInfo Implementation `json:"serverInfo"`
// 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"`
}
InitializeResult is sent after receiving an initialize request from the client.
type InitializedNotification ¶
type InitializedNotification struct {
jsonrpc.Notification
}
InitializedNotification is sent from the client to the server after initialization has finished.
type ListChanged ¶
type ListChanged struct {
ListChanged *bool `json:"listChanged,omitempty"`
}
ListChange represents whether the server supports notification for changes to the capabilities.
type ServerCapabilities ¶
type ServerCapabilities struct {
Tools *ListChanged `json:"tools,omitempty"`
}
ServerCapabilities represents 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.