tool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateServerTool

func CreateServerTool(blueprint Blueprint) *mcp.ServerTool

CreateServerTool creates a complete MCP server tool from a blueprint

func CreateToolFunction

func CreateToolFunction(blueprint Blueprint) mcp.ToolHandlerFor[map[string]any, map[string]any]

CreateToolFunction creates a tool handler for the given blueprint

func Execute

func Execute(command string, args ...string) (string, error)

Execute runs a command and returns trimmed combined stdout+stderr or an error

func GenerateToolName

func GenerateToolName(baseCommand string) string

GenerateToolName generates a tool name from a base command by replacing dashes with underscores

func GetToolDescription

func GetToolDescription(blueprint Blueprint) string

GetToolDescription generates the tool description from a blueprint

func IsDebugMode

func IsDebugMode() bool

IsDebugMode returns whether debug mode is enabled

func SetDebugMode

func SetDebugMode(enabled bool)

SetDebugMode enables or disables debug mode

func SetLogFile

func SetLogFile(filename string) error

SetLogFile sets the log file for debug output

Types

type Blueprint

type Blueprint interface {
	BuildCommandArgs(args map[string]interface{}) ([]string, error)
	GetBaseCommand() string
	GetCommandFormat() string
	GetInputSchema() interface{}
}

Blueprint interface defines what we need from a blueprint

Jump to

Keyboard shortcuts

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