Documentation
¶
Overview ¶
Code generated from JSON schema. DO NOT EDIT.
Index ¶
- Constants
- Variables
- type Agent
- type Annotations
- type AudioContent
- type BaseMetadata
- type BlobResourceContents
- type BooleanSchema
- type CallToolRequest
- type CallToolResult
- type CancelledNotification
- type ClientCapabilities
- type ClientNotification
- type ClientRequest
- type ClientResult
- type CompleteRequest
- type CompleteResult
- type ContentBlock
- type CreateMessageRequest
- type CreateMessageResult
- type Cursor
- type ElicitRequest
- type ElicitResult
- type EmbeddedResource
- type EmptyResult
- type EnumSchema
- type ErrorResponse
- type GetPromptRequest
- type GetPromptResult
- type ImageContent
- type Implementation
- type InitializeRequest
- type InitializeResult
- type InitializedNotification
- type JSONRPCError
- type JSONRPCMessage
- type JSONRPCNotification
- type JSONRPCRequest
- type JSONRPCResponse
- type ListPromptsRequest
- type ListPromptsResult
- type ListResourceTemplatesRequest
- type ListResourceTemplatesResult
- type ListResourcesRequest
- type ListResourcesResult
- type ListRootsRequest
- type ListRootsResult
- type ListToolsRequest
- type ListToolsResult
- type LoggingLevel
- type LoggingMessageNotification
- type MCPClient
- func (mc *MCPClient) BuildSSEFallbackURL(serverURL string) string
- func (mc *MCPClient) ConvertMCPToolsToChatCompletionTools(serverTools []Tool) []providers.ChatCompletionTool
- func (mc *MCPClient) ExecuteTool(ctx context.Context, request Request, serverURL string) (*CallToolResult, error)
- func (mc *MCPClient) GetAllChatCompletionTools() []providers.ChatCompletionTool
- func (mc *MCPClient) GetAllServerStatuses() map[string]ServerStatus
- func (mc *MCPClient) GetServerCapabilities() map[string]ServerCapabilities
- func (mc *MCPClient) GetServerForTool(toolName string) (string, error)
- func (mc *MCPClient) GetServerStatus(serverURL string) ServerStatus
- func (mc *MCPClient) GetServerTools(serverURL string) ([]Tool, error)
- func (mc *MCPClient) GetServers() []string
- func (mc *MCPClient) InitializeAll(ctx context.Context) error
- func (mc *MCPClient) IsInitialized() bool
- func (mc *MCPClient) NewClient(url string) *m.Client
- func (mc *MCPClient) NewClientWithTransport(serverURL string, mode TransportMode) *m.Client
- func (mc *MCPClient) StartStatusPolling(ctx context.Context)
- func (mc *MCPClient) StopStatusPolling()
- type MCPClientInterface
- type ModelHint
- type ModelPreferences
- type Notification
- type NumberSchema
- type PaginatedRequest
- type PaginatedResult
- type PingRequest
- type PrimitiveSchemaDefinition
- type ProgressNotification
- type ProgressToken
- type Prompt
- type PromptArgument
- type PromptListChangedNotification
- type PromptMessage
- type PromptReference
- type ReadResourceRequest
- type ReadResourceResult
- type Request
- type RequestId
- type Resource
- type ResourceContents
- type ResourceLink
- type ResourceListChangedNotification
- type ResourceTemplate
- type ResourceTemplateReference
- type ResourceUpdatedNotification
- type Result
- type Role
- type Root
- type RootsListChangedNotification
- type SamplingMessage
- type ServerCapabilities
- type ServerNotification
- type ServerRequest
- type ServerResult
- type ServerStatus
- type SetLevelRequest
- type StringSchema
- type SubscribeRequest
- type TextContent
- type TextResourceContents
- type Tool
- type ToolAnnotations
- type ToolListChangedNotification
- type TransportMode
- type UnsubscribeRequest
Constants ¶
const MaxAgentIterations = 10
MaxAgentIterations limits the number of agent loop iterations
Variables ¶
var ( // ErrClientNotInitialized is returned when a client method is called before initialization ErrClientNotInitialized = errors.New("mcp client not initialized") // ErrServerNotFound is returned when trying to use a server that doesn't exist ErrServerNotFound = errors.New("mcp server not found") // ErrNoServerURLs is returned when trying to initialize without any server URLs ErrNoServerURLs = errors.New("no mcp server urls provided") // ErrNoClientsInitialized is returned when no clients could be initialized ErrNoClientsInitialized = errors.New("no mcp clients could be initialized") )
Functions ¶
This section is empty.
Types ¶
type Agent ¶ added in v0.10.0
type Agent interface { Run(ctx context.Context, request *providers.CreateChatCompletionRequest, response *providers.CreateChatCompletionResponse) error RunWithStream(ctx context.Context, middlewareStreamCh chan []byte, c *gin.Context, body *providers.CreateChatCompletionRequest) error ExecuteTools(ctx context.Context, toolCalls []providers.ChatCompletionMessageToolCall) ([]providers.Message, error) SetProvider(provider providers.IProvider) SetModel(model *string) }
Agent defines the interface for running agent operations
type Annotations ¶
type Annotations struct { Audience []Role `json:"audience,omitempty"` LastModified *string `json:"lastModified,omitempty"` Priority *float64 `json:"priority,omitempty"` }
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
type AudioContent ¶
type AudioContent struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Data []byte `json:"data"` MIMEType string `json:"mimeType"` Type string `json:"type"` }
Audio provided to or from an LLM.
type BaseMetadata ¶ added in v0.15.1
Base interface for metadata with name (identifier) and title (display name) properties.
type BlobResourceContents ¶
type BooleanSchema ¶ added in v0.8.0
type CallToolRequest ¶
type CallToolRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
Used by the client to invoke a tool provided by the server.
type CallToolResult ¶
type CallToolResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Content []ContentBlock `json:"content"` IsError *bool `json:"isError,omitempty"` StructuredContent map[string]interface{} `json:"structuredContent,omitempty"` }
The server's response to a tool call.
type CancelledNotification ¶
type CancelledNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type ClientCapabilities ¶
type ClientCapabilities struct { Elicitation map[string]interface{} `json:"elicitation,omitempty"` Experimental map[string]map[string]interface{} `json:"experimental,omitempty"` Roots map[string]interface{} `json:"roots,omitempty"` Sampling map[string]interface{} `json:"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 ClientNotification ¶
type ClientNotification interface{}
type ClientRequest ¶
type ClientRequest interface{}
type ClientResult ¶
type ClientResult interface{}
type CompleteRequest ¶
type CompleteRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
A request from the client to the server, to ask for completion options.
type CompleteResult ¶
type CompleteResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Completion map[string]interface{} `json:"completion"` }
The server's response to a completion/complete request
type ContentBlock ¶ added in v0.15.1
type ContentBlock interface{}
type CreateMessageRequest ¶
type CreateMessageRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type CreateMessageResult ¶
type CreateMessageResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Content interface{} `json:"content"` Model string `json:"model"` Role Role `json:"role"` StopReason *string `json:"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.
type ElicitRequest ¶ added in v0.8.0
type ElicitRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
A request from the server to elicit additional information from the user via the client.
type ElicitResult ¶ added in v0.8.0
type ElicitResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Action string `json:"action"` Content map[string]interface{} `json:"content,omitempty"` }
The client's response to an elicitation request.
type EmbeddedResource ¶
type EmbeddedResource struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Resource interface{} `json:"resource"` Type string `json:"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.
type EmptyResult ¶
type EmptyResult struct { }
type EnumSchema ¶ added in v0.8.0
type ErrorResponse ¶ added in v0.10.0
type ErrorResponse struct {
Error string `json:"error"`
}
type GetPromptRequest ¶
type GetPromptRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
Used by the client to get a prompt provided by the server.
type GetPromptResult ¶
type GetPromptResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Description *string `json:"description,omitempty"` Messages []PromptMessage `json:"messages"` }
The server's response to a prompts/get request from the client.
type ImageContent ¶
type ImageContent struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Data []byte `json:"data"` MIMEType string `json:"mimeType"` Type string `json:"type"` }
An image provided to or from an LLM.
type Implementation ¶
type Implementation struct { Name string `json:"name"` Title *string `json:"title,omitempty"` Version string `json:"version"` }
Describes the name and version of an MCP implementation, with an optional title for UI representation.
type InitializeRequest ¶
type InitializeRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
This request is sent from the client to the server when it first connects, asking it to begin initialization.
type InitializeResult ¶
type InitializeResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Capabilities ServerCapabilities `json:"capabilities"` Instructions *string `json:"instructions,omitempty"` ProtocolVersion string `json:"protocolVersion"` ServerInfo Implementation `json:"serverInfo"` }
After receiving an initialize request from the client, the server sends this response.
type InitializedNotification ¶
type InitializedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
This notification is sent from the client to the server after initialization has finished.
type JSONRPCError ¶
type JSONRPCError struct { Error map[string]interface{} `json:"error"` ID RequestId `json:"id"` JSONRPC string `json:"jsonrpc"` }
A response to a request that indicates an error occurred.
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 string `json:"jsonrpc"` Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
A notification which does not expect a response.
type JSONRPCRequest ¶
type JSONRPCRequest struct { ID RequestId `json:"id"` JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
A request that expects a response.
type JSONRPCResponse ¶
type JSONRPCResponse struct { ID RequestId `json:"id"` JSONRPC string `json:"jsonrpc"` Result Result `json:"result"` }
A successful (non-error) response to a request.
type ListPromptsRequest ¶
type ListPromptsRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
Sent from the client to request a list of prompts and prompt templates the server has.
type ListPromptsResult ¶
type ListPromptsResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` NextCursor *string `json:"nextCursor,omitempty"` Prompts []Prompt `json:"prompts"` }
The server's response to a prompts/list request from the client.
type ListResourceTemplatesRequest ¶
type ListResourceTemplatesRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
Sent from the client to request a list of resource templates the server has.
type ListResourceTemplatesResult ¶
type ListResourceTemplatesResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` NextCursor *string `json:"nextCursor,omitempty"` ResourceTemplates []ResourceTemplate `json:"resourceTemplates"` }
The server's response to a resources/templates/list request from the client.
type ListResourcesRequest ¶
type ListResourcesRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
Sent from the client to request a list of resources the server has.
type ListResourcesResult ¶
type ListResourcesResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` NextCursor *string `json:"nextCursor,omitempty"` Resources []Resource `json:"resources"` }
The server's response to a resources/list request from the client.
type ListRootsRequest ¶
type ListRootsRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type ListRootsResult ¶
type ListRootsResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Roots []Root `json:"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.
type ListToolsRequest ¶
type ListToolsRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params,omitempty"` }
Sent from the client to request a list of tools the server has.
type ListToolsResult ¶
type ListToolsResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` NextCursor *string `json:"nextCursor,omitempty"` Tools []Tool `json:"tools"` }
The server's response to a tools/list request from the client.
type LoggingLevel ¶
type LoggingLevel string
The severity of a log message.
These map to syslog message severities, as specified in RFC-5424: https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
const ( LoggingLevelAlert LoggingLevel = "alert" LoggingLevelCritical LoggingLevel = "critical" LoggingLevelDebug LoggingLevel = "debug" LoggingLevelEmergency LoggingLevel = "emergency" LoggingLevelError LoggingLevel = "error" LoggingLevelInfo LoggingLevel = "info" LoggingLevelNotice LoggingLevel = "notice" LoggingLevelWarning LoggingLevel = "warning" )
LoggingLevel enum values
type LoggingMessageNotification ¶
type LoggingMessageNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type MCPClient ¶
type MCPClient struct { ServerURLs []string Clients map[string]*m.Client Logger logger.Logger Config config.Config ServerCapabilities map[string]ServerCapabilities ServerTools map[string][]Tool ChatCompletionTools []providers.ChatCompletionTool Initialized bool ServerStatuses map[string]ServerStatus // contains filtered or unexported fields }
MCPClient provides methods to interact with MCP servers
func (*MCPClient) BuildSSEFallbackURL ¶ added in v0.7.3
BuildSSEFallbackURL creates an SSE fallback URL from the main server URL
func (*MCPClient) ConvertMCPToolsToChatCompletionTools ¶
func (mc *MCPClient) ConvertMCPToolsToChatCompletionTools(serverTools []Tool) []providers.ChatCompletionTool
ConvertMCPToolsToChatCompletionTools converts MCP server tools to chat completion tools
func (*MCPClient) ExecuteTool ¶
func (mc *MCPClient) ExecuteTool(ctx context.Context, request Request, serverURL string) (*CallToolResult, error)
ExecuteTool implements MCPClientInterface.
func (*MCPClient) GetAllChatCompletionTools ¶
func (mc *MCPClient) GetAllChatCompletionTools() []providers.ChatCompletionTool
GetAllChatCompletionTools returns all pre-converted chat completion tools from all servers
func (*MCPClient) GetAllServerStatuses ¶ added in v0.16.0
func (mc *MCPClient) GetAllServerStatuses() map[string]ServerStatus
GetAllServerStatuses returns the status of all servers
func (*MCPClient) GetServerCapabilities ¶
func (mc *MCPClient) GetServerCapabilities() map[string]ServerCapabilities
GetServerCapabilities implements MCPClientInterface.
func (*MCPClient) GetServerForTool ¶ added in v0.14.0
GetServerForTool returns the server URL that provides the specified tool
func (*MCPClient) GetServerStatus ¶ added in v0.16.0
func (mc *MCPClient) GetServerStatus(serverURL string) ServerStatus
GetServerStatus returns the status of a specific server
func (*MCPClient) GetServerTools ¶
func (*MCPClient) GetServers ¶
func (*MCPClient) InitializeAll ¶
InitializeAll implements MCPClientInterface with enhanced transport fallback.
func (*MCPClient) IsInitialized ¶
IsInitialized implements MCPClientInterface.
func (*MCPClient) NewClient ¶
NewClient creates a new MCP client for a given server URL with enhanced transport support
func (*MCPClient) NewClientWithTransport ¶ added in v0.7.3
func (mc *MCPClient) NewClientWithTransport(serverURL string, mode TransportMode) *m.Client
NewClientWithTransport creates a new MCP client with specific transport mode
func (*MCPClient) StartStatusPolling ¶ added in v0.16.0
StartStatusPolling starts the background status polling goroutine
func (*MCPClient) StopStatusPolling ¶ added in v0.16.0
func (mc *MCPClient) StopStatusPolling()
StopStatusPolling stops the background status polling goroutine
type MCPClientInterface ¶
type MCPClientInterface interface { // InitializeAll establishes connection with MCP servers and performs handshake InitializeAll(ctx context.Context) error // IsInitialized returns whether the client has been successfully initialized IsInitialized() bool // ExecuteTool invokes a tool on the appropriate MCP server ExecuteTool(ctx context.Context, request Request, serverURL string) (*CallToolResult, error) // GetServerCapabilities returns the server capabilities map GetServerCapabilities() map[string]ServerCapabilities // GetServers returns the list of MCP server URLs GetServers() []string // GetServerTools returns the tools available on the specified server GetServerTools(serverURL string) ([]Tool, error) // GetAllChatCompletionTools returns all pre-converted chat completion tools from all servers GetAllChatCompletionTools() []providers.ChatCompletionTool // ConvertMCPToolsToChatCompletionTools converts MCP server tools to chat completion tools ConvertMCPToolsToChatCompletionTools([]Tool) []providers.ChatCompletionTool // GetServerForTool returns the server URL that provides the specified tool GetServerForTool(toolName string) (string, error) // BuildSSEFallbackURL creates an SSE fallback URL from the main server URL (exposed for testing) BuildSSEFallbackURL(serverURL string) string // GetServerStatus returns the status of a specific server GetServerStatus(serverURL string) ServerStatus // GetAllServerStatuses returns the status of all servers GetAllServerStatuses() map[string]ServerStatus // StartStatusPolling starts the background status polling goroutine StartStatusPolling(ctx context.Context) // StopStatusPolling stops the background status polling goroutine StopStatusPolling() }
MCPClientInterface defines the interface for MCP client implementations
func NewMCPClient ¶
NewMCPClient is a variable holding the function to create a new MCP client
type ModelHint ¶
type ModelHint struct {
Name *string `json:"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 { CostPriority *float64 `json:"costPriority,omitempty"` Hints []ModelHint `json:"hints,omitempty"` IntelligencePriority *float64 `json:"intelligencePriority,omitempty"` SpeedPriority *float64 `json:"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.
type Notification ¶
type NumberSchema ¶ added in v0.8.0
type PaginatedRequest ¶
type PaginatedResult ¶
type PingRequest ¶
type PingRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type PrimitiveSchemaDefinition ¶ added in v0.8.0
type PrimitiveSchemaDefinition interface{}
Restricted schema definitions that only allow primitive types without nested objects or arrays.
type ProgressNotification ¶
type ProgressNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
type ProgressToken ¶
type ProgressToken struct { }
A progress token, used to associate progress notifications with the original request.
type Prompt ¶
type Prompt struct { Meta map[string]interface{} `json:"_meta,omitempty"` Arguments []PromptArgument `json:"arguments,omitempty"` Description *string `json:"description,omitempty"` Name string `json:"name"` Title *string `json:"title,omitempty"` }
A prompt or prompt template that the server offers.
type PromptArgument ¶
type PromptArgument struct { Description *string `json:"description,omitempty"` Name string `json:"name"` Required *bool `json:"required,omitempty"` Title *string `json:"title,omitempty"` }
Describes an argument that a prompt can accept.
type PromptListChangedNotification ¶
type PromptListChangedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type PromptMessage ¶
type PromptMessage struct { Content ContentBlock `json:"content"` Role Role `json:"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.
type PromptReference ¶
type PromptReference struct { Name string `json:"name"` Title *string `json:"title,omitempty"` Type string `json:"type"` }
Identifies a prompt.
type ReadResourceRequest ¶
type ReadResourceRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
Sent from the client to the server, to read a specific resource URI.
type ReadResourceResult ¶
type ReadResourceResult struct { Meta map[string]interface{} `json:"_meta,omitempty"` Contents []interface{} `json:"contents"` }
The server's response to a resources/read request from the client.
type Resource ¶
type Resource struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` MIMEType *string `json:"mimeType,omitempty"` Name string `json:"name"` Size *int `json:"size,omitempty"` Title *string `json:"title,omitempty"` URI string `json:"uri"` }
A known resource that the server is capable of reading.
type ResourceContents ¶
type ResourceContents struct { Meta map[string]interface{} `json:"_meta,omitempty"` MIMEType *string `json:"mimeType,omitempty"` URI string `json:"uri"` }
The contents of a specific resource or sub-resource.
type ResourceLink ¶ added in v0.15.1
type ResourceLink struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` MIMEType *string `json:"mimeType,omitempty"` Name string `json:"name"` Size *int `json:"size,omitempty"` Title *string `json:"title,omitempty"` Type string `json:"type"` URI string `json:"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.
type ResourceListChangedNotification ¶
type ResourceListChangedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type ResourceTemplate ¶
type ResourceTemplate struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` MIMEType *string `json:"mimeType,omitempty"` Name string `json:"name"` Title *string `json:"title,omitempty"` URITemplate string `json:"uriTemplate"` }
A template description for resources available on the server.
type ResourceTemplateReference ¶ added in v0.15.1
A reference to a resource or resource template definition.
type ResourceUpdatedNotification ¶
type ResourceUpdatedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type Root ¶
type Root struct { Meta map[string]interface{} `json:"_meta,omitempty"` Name *string `json:"name,omitempty"` URI string `json:"uri"` }
Represents a root directory or file that the server can operate on.
type RootsListChangedNotification ¶
type RootsListChangedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type SamplingMessage ¶
type SamplingMessage struct { Content interface{} `json:"content"` Role Role `json:"role"` }
Describes a message issued to or received from an LLM API.
type ServerCapabilities ¶
type ServerCapabilities struct { Completions map[string]interface{} `json:"completions,omitempty"` Experimental map[string]map[string]interface{} `json:"experimental,omitempty"` Logging map[string]interface{} `json:"logging,omitempty"` Prompts map[string]interface{} `json:"prompts,omitempty"` Resources map[string]interface{} `json:"resources,omitempty"` Tools map[string]interface{} `json:"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 ServerNotification ¶
type ServerNotification interface{}
type ServerRequest ¶
type ServerRequest interface{}
type ServerResult ¶
type ServerResult interface{}
type ServerStatus ¶ added in v0.16.0
type ServerStatus string
ServerStatus represents the status of an MCP server
const ( ServerStatusUnknown ServerStatus = "unknown" ServerStatusAvailable ServerStatus = "available" )
type SetLevelRequest ¶
type SetLevelRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
A request from the client to the server, to enable or adjust logging.
type StringSchema ¶ added in v0.8.0
type SubscribeRequest ¶
type SubscribeRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
type TextContent ¶
type TextContent struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` Text string `json:"text"` Type string `json:"type"` }
Text provided to or from an LLM.
type TextResourceContents ¶
type Tool ¶
type Tool struct { Meta map[string]interface{} `json:"_meta,omitempty"` Annotations *ToolAnnotations `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` InputSchema map[string]interface{} `json:"inputSchema"` Name string `json:"name"` OutputSchema map[string]interface{} `json:"outputSchema,omitempty"` Title *string `json:"title,omitempty"` }
Definition for a tool the client can call.
type ToolAnnotations ¶
type ToolAnnotations struct { DestructiveHint *bool `json:"destructiveHint,omitempty"` IdempotentHint *bool `json:"idempotentHint,omitempty"` OpenWorldHint *bool `json:"openWorldHint,omitempty"` ReadOnlyHint *bool `json:"readOnlyHint,omitempty"` Title *string `json:"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 ToolListChangedNotification ¶
type ToolListChangedNotification struct { Method string `json:"method"` Params map[string]interface{} `json:"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.
type TransportMode ¶ added in v0.7.3
type TransportMode string
TransportMode represents the type of transport being used
const ( TransportModeStreamableHTTP TransportMode = "streamable-http" TransportModeSSE TransportMode = "sse" TransportModeHTTP TransportMode = "http" )
type UnsubscribeRequest ¶
type UnsubscribeRequest struct { Method string `json:"method"` Params map[string]interface{} `json:"params"` }
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.