Quick Start
1
Summarise a function tool
427 lines, while the display and any AFTER_TOOL hook still receive the full log.2
Carry the compact view on the result
output reaches display and hooks; the LLM sees the one-line model_output.3
Override on a class-based tool
How It Works
The full result flows to tracing, hooks, loop detection, and the loop guard first; the compact view is swapped in only at the end, right before the model sees it. The executor resolves the compact view in a fixed order; the first hit wins.AFTER_TOOL annotations (_additional_context) and any [loop-guard] notice are re-applied to the compact view, so they always reach the model. The multimodal content channel is untouched, and external-tool output still passes the prompt-injection fence.
How to Choose
Pick the surface that matches how your tool is defined.Configuration Options
Every surface defaults toNone, which keeps today’s behaviour where the model sees the full output.
Common Patterns
Return the smallest signal the model needs for its next decision.Best Practices
Keep the compact view deterministic
Keep the compact view deterministic
It runs on every tool call, so avoid network or LLM calls inside it. Build the summary from data you already have.
Return the smallest useful signal
Return the smallest useful signal
Give the model just enough to decide its next step — a count, a title, a diff — not a second copy of the output.
Never rely on the compact view for correctness
Never rely on the compact view for correctness
Hooks, memory, and downstream tools still receive the full
output. The compact view is for the LLM’s eyes only.Fail soft — no try/except needed
Fail soft — no try/except needed
The executor already falls back to the full output when a builder raises, and logs a warning. Keep your builder simple.
Related
Tools
The tools overview page.
Tool Output Spill
Complementary built-in disk spill for large
execute_command output.Multimodal Tool Output
The sibling
content channel — untouched by this feature.Runtime Tool Result Middleware
Normalises plugin-harness results before hooks fire.

