Quick check
Check that the agent can tell an incomplete page from a complete search with no match.
Download the test script · node check-tool-output.mjs
Six cases cover matches on both pages, pagination, no match, a missing cursor and source failure.
Synthetic inputs. This tests the rule and makes no model or cost claims.Design the response
Pick the decision the agent must make. Return the necessary fields, the search scope and a cursor when the response is incomplete. Keep a tool error distinct from an empty successful result.
Nobody asked the search tool to bring the filing cabinet.
Verify the behaviour
Test a first-page match, a last-page match and a complete search without a match. Add cases for a missing cursor and a source failure. Compare the final answer and all tool calls with the full-output version.
The downloadable fixture checks the expected classifications on synthetic inputs. It does not measure model performance or token savings.
Sources and origin
- Anthropic Engineering · Writing effective tools for agents
Primary engineering guidance on meaningful tool outputs, pagination and evaluation. The fixture on this page is synthetic.