Skip to main content

Module tool

Module tool 

Source
Expand description

Tool — the only side-effectful interface available to skills and agents.

A Tool is a typed, named, async function with a JSON-Schema-compatible signature. Two transports satisfy the trait today: LocalTool (a closure over a Rust async fn) and — under the mcp feature in a later phase — a remote MCP server. Skills never know the difference.

Structs§

LocalTool
Adapter that turns any async Fn(Value) -> Result<Value, KernelError> into a Tool. Hosts can use this to surface existing async functions to the kernel without writing a dedicated tool type.
ToolSchema
Lightweight description of a tool’s I/O contract. The args_schema and result_schema are JSON-Schema fragments; the LLM-facing rendering layer uses them to generate rig / MCP tool definitions automatically. We do not validate against them at the kernel — validation is the tool’s responsibility — but downstream MCP exporters need them.

Traits§

Tool
A composable, side-effectful capability.

Type Aliases§

ToolName
Stable, registry-unique identifier for a tool (e.g. "grammar.query", "memory.lookup", "sampler.expand").