Expand description
Native tool executors — Calculator and DateTimeTool.
Tools are pure functions that execute locally (no LLM call).
When a use_tool step references a known tool, the runner
intercepts it and calls the executor directly.
Supported tools:
- Calculator: safe arithmetic expression evaluator
- DateTimeTool: current date/time/timestamp queries
Structs§
- Tool
Result - Result of a tool execution.
Functions§
- calculator_
execute - Safe arithmetic expression evaluator.
- datetime_
execute - Current date/time queries using system time (UTC).
- dispatch
- Dispatch a tool call by name. Returns
Noneif the tool is not a native executor AND is not a declared-but-unimplemented stdlib tool (those legacy names still fall through to the LLM — seedispatch_or_rejectfor the stricter contract the runtime uses at real call sites). - dispatch_
or_ reject - v2.53.0 section 8 — the honest dispatch: a tool name DECLARED in
stdlib::TOOLSbut with no native executor and no LLM provider is a typed refusal, not a silent hand-off to the model. This closes the pre-existing defect where calling e.g.PDFExtractor(declared, unimplemented) returned the model inventing the PDF’s contents, shaped exactly like a real extraction. ReturnsErrfor such names;Ok(Some)for a real native result;Ok(None)for a name with a legitimate non-native (LLM/provider) path.