Define tools with schemas
Write explicit JSON schemas so the model knows required fields, types, and enum values.
{
"name": "create_ticket",
"description": "Create a support ticket",
"parameters": {
"type": "object",
"properties": {
"title": { "type": "string" },
"priority": { "type": "string", "enum": ["low", "medium", "high"] }
},
"required": ["title", "priority"]
}
}Validate arguments
Run schema validation before executing a tool. Reject or repair invalid inputs.
Use a retry policy
Retry tool calls with exponential backoff and clear error messages. Avoid infinite loops.