Documentation
¶
Index ¶
- type ClientCaps
- type ClientInfo
- type ContentBlock
- type InitializeParams
- type InitializeResult
- type PromptArgument
- type PromptDefinition
- type PromptGetParams
- type PromptGetResult
- type PromptMessage
- type PromptsCap
- type PromptsListResult
- type RPCError
- type Request
- type ResourceContent
- type ResourceDefinition
- type ResourceReadParams
- type ResourceReadResult
- type ResourcesCap
- type ResourcesListResult
- type Response
- type Server
- type ServerCaps
- type ServerInfo
- type ToolCallParams
- type ToolDefinition
- type ToolResult
- type ToolsCap
- type ToolsListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCaps ¶
type ClientCaps struct{}
ClientCaps describes the client's capabilities (minimal for now).
type ClientInfo ¶
type ClientInfo struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
}
ClientInfo identifies the client.
type ContentBlock ¶
ContentBlock is a single content item in a tool result.
type InitializeParams ¶
type InitializeParams struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ClientCaps `json:"capabilities"`
ClientInfo *ClientInfo `json:"clientInfo,omitempty"`
}
InitializeParams contains the parameters for the initialize request.
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ServerCaps `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
}
InitializeResult is the response to the initialize request.
type PromptArgument ¶
type PromptArgument struct {
Name string `json:"name"`
Description string `json:"description"`
Required bool `json:"required"`
}
PromptArgument describes a single argument for a prompt template.
type PromptDefinition ¶
type PromptDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Arguments []PromptArgument `json:"arguments,omitempty"`
}
PromptDefinition describes a prompt template available on the server.
type PromptGetParams ¶
type PromptGetParams struct {
Name string `json:"name"`
Arguments map[string]string `json:"arguments,omitempty"`
}
PromptGetParams contains the parameters for prompts/get.
type PromptGetResult ¶
type PromptGetResult struct {
Description string `json:"description,omitempty"`
Messages []PromptMessage `json:"messages"`
}
PromptGetResult is the result of prompts/get.
type PromptMessage ¶
type PromptMessage struct {
Role string `json:"role"`
Content ContentBlock `json:"content"`
}
PromptMessage is a single message in a prompt result.
type PromptsListResult ¶
type PromptsListResult struct {
Prompts []PromptDefinition `json:"prompts"`
}
PromptsListResult is the result of prompts/list.
type ResourceContent ¶
type ResourceContent struct {
URI string `json:"uri"`
MimeType string `json:"mimeType,omitempty"`
Text string `json:"text,omitempty"`
}
ResourceContent is the content of a single resource.
type ResourceDefinition ¶
type ResourceDefinition struct {
URI string `json:"uri"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
MimeType string `json:"mimeType,omitempty"`
}
ResourceDefinition describes a resource available on the server.
type ResourceReadParams ¶
type ResourceReadParams struct {
URI string `json:"uri"`
}
ResourceReadParams contains the parameters for resources/read.
type ResourceReadResult ¶
type ResourceReadResult struct {
Contents []ResourceContent `json:"contents"`
}
ResourceReadResult is the result of resources/read.
type ResourcesCap ¶
type ResourcesCap struct{}
ResourcesCap indicates the server supports resources.
type ResourcesListResult ¶
type ResourcesListResult struct {
Resources []ResourceDefinition `json:"resources"`
}
ResourcesListResult is the result of resources/list.
type Server ¶
type Server struct {
// Verbose gates informational log output.
Verbose bool
// contains filtered or unexported fields
}
Server implements an MCP server over stdio using JSON-RPC 2.0.
type ServerCaps ¶
type ServerCaps struct {
Tools *ToolsCap `json:"tools,omitempty"`
Resources *ResourcesCap `json:"resources,omitempty"`
Prompts *PromptsCap `json:"prompts,omitempty"`
}
ServerCaps describes the server's capabilities.
type ServerInfo ¶
ServerInfo contains information about the server.
type ToolCallParams ¶
type ToolCallParams struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments"`
}
ToolCallParams contains the parameters for tools/call.
type ToolDefinition ¶
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema interface{} `json:"inputSchema"`
}
ToolDefinition describes a tool available on the server.
type ToolResult ¶
type ToolResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
ToolResult is the result of a tool call.
type ToolsListResult ¶
type ToolsListResult struct {
Tools []ToolDefinition `json:"tools"`
}
ToolsListResult is the result of tools/list.