Documentation
¶
Index ¶
- Variables
- func FormatMessages(messages []store.LogMessage) string
- func TruncateMessages(messages []store.LogMessage, maxLines int) []store.LogMessage
- type CallToolParams
- type CallToolResult
- type Capabilities
- type ContentBlock
- type Error
- type InitializeResult
- type InputSchema
- type Property
- type Request
- type Response
- type Server
- type ServerInfo
- type Tool
- type ToolsCapability
- type ToolsListResult
Constants ¶
This section is empty.
Variables ¶
var ServerVersion = "dev"
ServerVersion can be set by the caller to match the binary version.
Functions ¶
func FormatMessages ¶
func FormatMessages(messages []store.LogMessage) string
FormatMessages converts log messages into a human-readable string.
func TruncateMessages ¶
func TruncateMessages(messages []store.LogMessage, maxLines int) []store.LogMessage
TruncateMessages applies line-level truncation across messages. It allocates the maxLines budget proportionally to each message, using filter.Truncate for smart head/tail truncation per message.
Types ¶
type CallToolParams ¶
type CallToolParams struct {
Name string `json:"name"`
Arguments map[string]any `json:"arguments,omitempty"`
}
CallToolParams holds parameters for tools/call.
type CallToolResult ¶
type CallToolResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
CallToolResult is returned for tools/call.
type Capabilities ¶
type Capabilities struct {
Tools *ToolsCapability `json:"tools,omitempty"`
}
Capabilities declares what the server supports.
type ContentBlock ¶
ContentBlock holds tool output.
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities Capabilities `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
}
InitializeResult is returned for initialize requests.
type InputSchema ¶
type InputSchema struct {
Type string `json:"type"`
Properties map[string]Property `json:"properties,omitempty"`
}
InputSchema is a JSON Schema for tool inputs.
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id,omitempty"` // may be absent for notifications
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
Request represents a JSON-RPC 2.0 request.
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Result any `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Response represents a JSON-RPC 2.0 response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements an MCP stdio server that exposes devtap tools.
type ServerInfo ¶
ServerInfo provides server metadata.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema InputSchema `json:"inputSchema"`
}
Tool describes a callable tool.
type ToolsCapability ¶
type ToolsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
ToolsCapability indicates tool support.
type ToolsListResult ¶
type ToolsListResult struct {
Tools []Tool `json:"tools"`
}
ToolsListResult is returned for tools/list.