Documentation
¶
Overview ¶
Package tools provides functionality for managing MCP tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerDisconnected = errors.New("server is disconnected") ErrNoConnection = errors.New("no connection available") )
Common errors that can occur during MCP tool operations
Functions ¶
func CreateToolHandler ¶
func CreateToolHandler( toolName string, serverURL string, getConnectionState func(string) models.ConnectionState, getToolHandlers func() map[string]*RemoteToolInfo, checkConnections func(), ) func(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateToolHandler creates a handler for a remote MCP tool
func HelloHandler ¶
func HelloHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
HelloHandler handles the hello_world tool call
Types ¶
type RemoteToolInfo ¶
type RemoteToolInfo struct { Tool mcp.Tool ServerURL string IsEnabled bool HandlerFn func(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error) }
RemoteToolInfo tracks information about a tool from a remote server
Click to show internal directories.
Click to hide internal directories.