Specify effects and failures in the tool contract
A tool contract should describe required inputs, permitted values, authorization assumptions and the effect of a successful call. Include errors and ambiguous outcomes, not only the happy path. Distinguish read operations from writes and make consequential parameters explicit. The application must validate these rules independently of the model's understanding.
Worked example
Illustrative scenario; not a claim of measured client results.
For a task-creation tool, define the workspace identifier, title, assignee and duplicate-handling behavior. A response should identify whether a task was created, already existed or failed. Returning a generic success message without the resulting record makes later verification difficult. Avoid accepting arbitrary destination identifiers when the workflow should operate only within a known scope.
Checks, limitations and next decisions
Test missing fields, invalid identifiers, unavailable services and repeated requests. Ensure the agent can interpret a failure without guessing that the action completed. Keep tool descriptions aligned with actual behavior as the integration evolves. A clear contract reduces ambiguity, but server-side validation and authorization remain responsible for enforcing the boundary.
A practical starting point
Work through these checks in order. Use the results to decide what needs to change in your own workflow.
- Specify required fields and validate them outside the model.
- Describe whether the tool reads data or changes it.
- Return structured success and error information that supports recovery.
A mistake to avoid
Do not rely on a natural-language instruction as the only input validation.
How to check progress
Track invalid calls, ambiguous results and recovery success.
Your action checklist
Use this checklist while reviewing your own setup. Checkmarks are temporary and stay in this open page.
For the wider decision process, read Choosing an agent when a workflow is not a fixed script.
Further reading
Official background resources for this topic. The workflow above is general guidance, not a guarantee of a particular result.
AI-assisted editorial content. Examples are illustrative, not client case studies. Read our editorial policy or report a correction.
