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.
OmittedSegment
One omitted payload segment and its opaque continuation token.
RedactionPolicy
JSON Pointer redaction policy for tool results.
RedactionRule
One JSON Pointer redaction rule.
ToolResultEnvelope
Tool result plus deterministic truncation metadata.
ToolResultEnvelopeConfig
Configuration for bounding large tool results before they enter a model turn, trace record, or MCP response cache.
ToolResultPageToken
Decoded continuation token metadata for a bounded tool result segment.
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.

Enums§

ToolResultOmissionReason
Reason an individual payload segment was omitted from a tool result envelope.

Traits§

Tool
A composable, side-effectful capability.

Functions§

bound_tool_result
Bound payload with the default ToolResultEnvelopeConfig.
decode_tool_result_page_token
Decode a ToolResultEnvelope page token produced by this crate.

Type Aliases§

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