A well-formed tool call can still contain an impossible date, the wrong customer, or an unauthorised destination. Validate argument structure and business meaning before any voice-driven write reaches the system of record.
Tool validation has distinct layers
Argument validation checks whether supplied data meets the tool contract and the operation’s domain rules. It does not establish that the caller has authority to perform the action. Treat schema validation, business validation, and authorisation as separate checks with separate errors.
For a proposed appointment tool, structural checks cover required identifiers, field types, allowed values, and unexpected properties. Domain checks cover timezone interpretation, opening hours, service duration, and whether the selected resource supports that service. Authorisation checks whether this interaction may change the identified appointment.
The JSON Schema object reference explains required and additional properties. A schema can constrain shape, but a valid string is not proof that a customer identifier exists or belongs to the correct account.
Examine a fictional booking payload
The caller asks for “next Friday afternoon” while the model submits a timestamp without a timezone. Reject that incomplete representation or resolve it through an explicit clarification process. Do not let the server’s local timezone become an accidental booking policy.
Next, suppose the payload names a valid customer reference from another tenant. The request may pass schema validation and still must fail the authorisation boundary. The assistant should receive a safe error rather than private details about the other tenant’s account.
| Input defect | Expected handling |
|---|---|
| Missing timezone | Clarify before committing |
| Unsupported service identifier | Return an allowed recovery path |
| Negative duration | Reject without writing |
| Extra privileged field | Reject or ignore according to explicit contract |
| Cross-account customer reference | Deny without disclosing the record |
Check the resulting database state in every negative test. A spoken apology after an invalid write does not make validation successful.
Return errors the conversation can repair
Map failures to stable categories such as missing information, invalid value, stale availability, and not authorised. Include only the safe field-level detail needed for the next question. Avoid passing raw database errors into the conversation.
Overly permissive coercion hides mistakes. Turning an arbitrary string into a number or silently selecting a timezone can make the request appear valid while changing its meaning. Prefer explicit normalisation rules and preserve the caller’s original value for authorised investigation.
This is a proposed validation boundary. The voice platform case study covers related integration work. Continue with missing-field tests to exercise recovery, not just rejection.
Tool argument FAQ
Can prompt instructions replace backend validation?
No. The backend must enforce the contract for every caller, including malformed or unexpected requests.
Should every validation failure end the call?
No. Recoverable missing information should lead to a precise clarification question.
Should the model correct invalid identifiers itself?
Only through an authorised lookup or caller clarification. Guessing a plausible identifier can modify the wrong record.