Documentation
¶
Index ¶
- func CreateResourceHandler(handler ResourceHandler, cfg *config.ConfigData) ...
- func CreateToolHandler(executor CommandExecutor, cfg *config.ConfigData) ...
- func CreateToolHandlerWithName(executor CommandExecutor, cfg *config.ConfigData, toolName string) ...
- type CommandExecutor
- type CommandExecutorFunc
- type ResourceHandler
- type ResourceHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResourceHandler ¶
func CreateResourceHandler(handler ResourceHandler, cfg *config.ConfigData) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateResourceHandler creates an adapter that converts ResourceHandler to the format expected by MCP server
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
func CreateToolHandlerWithName ¶ added in v0.0.15
func CreateToolHandlerWithName(executor CommandExecutor, cfg *config.ConfigData, toolName string) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateToolHandlerWithName creates an adapter that injects the tool name into params for executors that need it
Types ¶
type CommandExecutor ¶
type CommandExecutor interface {
Execute(ctx context.Context, params map[string]interface{}, cfg *config.ConfigData) (string, error)
}
CommandExecutor defines the interface for executing CLI commands This ensures all command executors follow the same pattern and signature
type CommandExecutorFunc ¶
type CommandExecutorFunc func(ctx context.Context, 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(ctx context.Context, params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute implements the CommandExecutor interface for CommandExecutorFunc
type ResourceHandler ¶
type ResourceHandler interface {
Handle(ctx context.Context, params map[string]interface{}, cfg *config.ConfigData) (string, error)
}
ResourceHandler defines the interface for handling Azure SDK-based resource operations This interface is semantically different from CommandExecutor as it handles API calls rather than CLI commands
type ResourceHandlerFunc ¶
type ResourceHandlerFunc func(ctx context.Context, params map[string]interface{}, cfg *config.ConfigData) (string, error)
ResourceHandlerFunc is a function type that implements ResourceHandler This allows regular functions to be used as ResourceHandlers without having to create a struct
func (ResourceHandlerFunc) Handle ¶
func (f ResourceHandlerFunc) Handle(ctx context.Context, params map[string]interface{}, cfg *config.ConfigData) (string, error)
Handle implements the ResourceHandler interface for ResourceHandlerFunc