Documentation
¶
Overview ¶
Package toolsearch indexes allowed MCP tools and implements search tool responses.
Index ¶
Constants ¶
View Source
const ( // SearchToolName is the public MCP tool used to find available tools. SearchToolName = "search_tools" // CallToolName is the public MCP tool used to invoke a search result. CallToolName = "call_tool" )
Variables ¶
View Source
var ( // ErrNotReady indicates that the index did not become ready before the wait ended. ErrNotReady = errors.New("tool search index is not ready") )
Functions ¶
func Definitions ¶
Definitions returns the search and generic call MCP tool definitions.
Types ¶
type CallArguments ¶
type CallArguments struct {
Name string `json:"name"`
Revision string `json:"revision"`
Arguments json.RawMessage `json:"arguments,omitempty"`
}
CallArguments is the input accepted by the generic MCP call tool.
func ParseCallArguments ¶
func ParseCallArguments(arguments any) (CallArguments, error)
ParseCallArguments validates a generic tool call and defaults omitted arguments to an empty object.
type Document ¶
type Document struct {
ExposedName string
Component string
Reference Reference
Revision string
Tool *mcp.Tool
}
Document contains the effective tool definition and identity to index.
type Hit ¶
type Hit struct {
Reference Reference `json:"tool"`
Revision string `json:"revision"`
Component string `json:"component"`
Tool *mcp.Tool `json:"definition"`
}
Hit is a matching tool with the information needed to invoke it.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index owns one immutable snapshot's index and its background builder.
func (*Index) Revision ¶
Revision returns the revision indexed for a tool reference in this snapshot.
Click to show internal directories.
Click to hide internal directories.