Documentation
¶
Overview ¶
Package mcp provides an MCP (Model Context Protocol) server for the Tapes system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// SpanSearcher and Embedder optionally retain the legacy core search tool
// while search moves to a cassette. They must be supplied together.
SpanSearcher SpanSearcher
Embedder embeddings.Embedder
// Cassettes is the live registry whose advertised tools are exposed.
Cassettes *cassetterunner.Registry
// Client invokes admitted cassette operations. Nil uses a redirect-refusing client.
Client *http.Client
Logger *slog.Logger
}
type SearchInput ¶
type SearchInput struct {
Query string `json:"query" jsonschema:"the search query text to find relevant spans"`
TopK int `json:"top_k,omitempty" jsonschema:"number of results to return (default: 5)"`
}
SearchInput represents the input arguments for the MCP search tool. It uses jsonschema tags specific to the MCP protocol.
type SearchOutput ¶ added in v0.16.0
type SearchOutput struct {
Query string `json:"query"`
Results []SearchResult `json:"results"`
Count int `json:"count"`
}
SearchOutput is the MCP search response. It mirrors the HTTP /v1/search/spans response shape (api.SpanSearchOutput).
type SearchResult ¶ added in v0.16.0
type SearchResult struct {
SessionID string `json:"session_id,omitempty" jsonschema:"session the span belongs to"`
TraceID string `json:"trace_id" jsonschema:"trace (turn) the span belongs to"`
SpanID string `json:"span_id" jsonschema:"the matched span"`
Score float32 `json:"score" jsonschema:"vector similarity score"`
// UserPrompt is the prompt of the turn (trace) the span belongs to.
UserPrompt string `json:"user_prompt,omitempty" jsonschema:"prompt of the turn the span belongs to"`
// Snippet previews the matched span's delta-only text.
Snippet string `json:"snippet,omitempty" jsonschema:"preview of the matched span's text"`
Model string `json:"model,omitempty" jsonschema:"model that produced the span"`
StartedAt time.Time `json:"started_at" jsonschema:"when the span started"`
}
SearchResult is one span hit with its trace/turn context. It mirrors the HTTP /v1/search/spans response shape (api.SpanSearchResult).
Click to show internal directories.
Click to hide internal directories.