Skip to main content

Module tools

Module tools 

Source
Expand description

Tool system for kaish.

Tools are the primary way to perform actions in kaish. Every command is a tool — builtins, user-defined tools, and MCP tools all implement the same Tool trait.

§Architecture

ToolRegistry
├── Builtins (echo, ls, cat, ...)
├── User Tools (defined via `tool` statements)
└── MCP Tools (from connected MCP servers)

Structs§

ExecContext
Execution context passed to tools.
ParamSchema
Schema for a tool parameter.
ToolArgs
Parsed arguments ready for tool execution.
ToolRegistry
Registry of available tools.
ToolSchema
Schema describing a tool’s interface.

Enums§

OutputContext
Output context determines how command output should be formatted.

Traits§

Tool
A tool that can be executed.

Functions§

extract_output_format
Extract and remove a global output format flag from ToolArgs.
is_global_output_flag
Check if a flag name is a global output flag.
register_builtins
Register all built-in tools with the registry.
resolve_in_path
Resolve a command name in PATH.
validate_against_schema
Validate arguments against a tool schema.