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§
- Exec
Context - Execution context passed to tools.
- Param
Schema - Schema for a tool parameter.
- Tool
Args - Parsed arguments ready for tool execution.
- Tool
Registry - Registry of available tools.
- Tool
Schema - Schema describing a tool’s interface.
Enums§
- Output
Context - 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.