Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToolHandler ¶
func CreateToolHandler(executor CommandExecutor, cfg *config.ConfigData) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateToolHandler creates an adapter that converts CommandExecutor to the format expected by MCP server
Types ¶
type CommandExecutor ¶
type CommandExecutor interface {
Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
}
CommandExecutor defines the interface for executing commands This ensures all command executors follow the same pattern and signature
type CommandExecutorFunc ¶
type CommandExecutorFunc func(params map[string]interface{}, cfg *config.ConfigData) (string, error)
CommandExecutorFunc is a function type that implements CommandExecutor This allows regular functions to be used as CommandExecutors without having to create a struct
func (CommandExecutorFunc) Execute ¶
func (f CommandExecutorFunc) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute implements the CommandExecutor interface for CommandExecutorFunc
type ToolHandlerFunc ¶
type ToolHandlerFunc func(params map[string]interface{}, cfg *config.ConfigData) (interface{}, error)
ToolHandlerFunc is a function that processes tool requests Deprecated: Use CommandExecutorFunc instead
Click to show internal directories.
Click to hide internal directories.