Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run reads newline-delimited JSON-RPC requests from r and writes responses to w until EOF. No session state is retained across calls beyond the caller's *config.Config, which handlers treat as read-only per call — this server never mutates the process working directory or dump-state files (see the statelessness rule in tools.go).
Types ¶
type CallParams ¶
type CallParams struct {
Name string `json:"name"`
Arguments map[string]any `json:"arguments,omitempty"`
}
CallParams are the tools/call parameters: which tool plus its arguments.
type CallResult ¶
type CallResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
CallResult is the tools/call payload: human-readable content blocks.
type Capabilities ¶
Capabilities advertises exactly the tool surface; nothing else.
type ContentBlock ¶
ContentBlock is one text block in a tool result.
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities Capabilities `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
}
InitializeResult is the response payload for initialize.
type Property ¶
type Property struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
}
Property is a single named argument's schema.
type RPCError ¶
RPCError is a JSON-RPC 2.0 error object with the standard code space: -32601 method not found, -32602 invalid params, -32603 internal error.
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id,omitempty"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
Request is a single newline-delimited JSON-RPC 2.0 message. An absent ID marks a notification, which receives no reply.
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Result any `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
}
Response is the reply to a Request carrying an ID.
type Schema ¶
type Schema struct {
Type string `json:"type"`
Properties map[string]Property `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
}
Schema is the JSON Schema object constraining a tool's arguments.
type ServerInfo ¶
ServerInfo identifies this server to clients.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema Schema `json:"inputSchema"`
}
Tool describes one callable tool for tools/list.
type ToolsListResult ¶
type ToolsListResult struct {
Tools []Tool `json:"tools"`
}
ToolsListResult wraps tools/list output.