Skip to main content
Return a rich, full result from your tool while feeding the model a short summary — same tool, fewer tokens. Verbose tools flood the model with raw shell output, huge API JSON, or long retrievals when a one-line summary is all it needs to decide the next step. Attach one function and the executor sends the model the summary while everything else still receives the full result.

Quick Start

1

Summarise a function tool

The LLM sees only 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 to None, 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

It runs on every tool call, so avoid network or LLM calls inside it. Build the summary from data you already have.
Give the model just enough to decide its next step — a count, a title, a diff — not a second copy of the output.
Hooks, memory, and downstream tools still receive the full output. The compact view is for the LLM’s eyes only.
The executor already falls back to the full output when a builder raises, and logs a warning. Keep your builder simple.

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.