tools

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 4 Imported by: 0

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

func CreateToolHandlerWithName added in v0.0.5

func CreateToolHandlerWithName(executor CommandExecutor, cfg *config.ConfigData, toolName string) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

CreateToolHandlerWithName creates an adapter for tools that need the tool name injected

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL