Write Tool Contracts Before Connecting an AI Agent
A tool specification with validation rules for a practical business AI workflow, with steps, an acceptance test, and a reusable prompt.
By Dr. Connor Robertson · Published October 24, 2026 · Implementation playbook
Deliverable: A tool specification with validation rules. Use this playbook when your team needs a repeatable operating decision with evidence that another person can inspect.
The business situation
A CRM lookup tool and a task creation tool for preparing sales follow-ups. This is an illustrative scenario, not a reported client result. Start with a small approved sample and the actual constraints of your team.
The operating approach
Describe every tool as a contract: accepted fields, required identifiers, allowed values, return fields, failure states, and whether the operation changes external data. Validate these properties in code outside the model.
Build it step by step
- Start with a read-only lookup and sample response.
- Use stable customer IDs instead of fuzzy names for mutations.
- Reject missing fields and unsupported status values before execution.
- Return machine-readable success and error results with a request ID.
A concrete acceptance test
Supply two contacts with the same name. The agent should request the correct identifier, rather than guess. Give an invalid due date and confirm the tool rejects it.
Record the input, expected behavior, actual result, reviewer, and version tested. Repeat this case after a prompt, source, model, or integration change. Include the cases that failed in the next regression run.
The mistake to avoid
A descriptive prompt is not an authorization system. Enforce access and field validation in the tool service.
A reusable working prompt
Draft a contract for this tool: purpose, typed inputs, preconditions, side effects, response fields, and errors. Include one valid request and three rejected requests. Identify the permission boundary.
Replace general descriptions with your approved process details. The prompt helps prepare an artifact; the process owner verifies the finished result before it changes a live workflow.
What to keep in the handoff
Save the accepted a tool specification with validation rules, its source versions, test evidence, unresolved questions, and a named owner. Set a review trigger tied to a meaningful business change, rather than leaving the pilot without maintenance.
Continue implementation
- Prevent Duplicate Actions in AI Automations
- Design an Approval Inbox for AI-Proposed Actions
- Copy the implementation templates
- Calculate review-adjusted AI ROI
Explore AI Agents and Integrations or contact Dr. Connor Robertson about your business workflow.