validate_tool_args
Validates a tool-call arguments object against a specified shape, returning validity status, error details, and a ready-to-send retry hint for the LLM to correct mistakes.
Instructions
Validate a tool-call args object against a small shape spec. Returns { valid, error?, retry_hint? } where retry_hint is a ready-to-send LLM feedback message describing exactly what was wrong.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool_name | Yes | Name of the tool being called (surfaces in retry_hint). | |
| args | Yes | The args object the LLM wants to pass. | |
| shape | Yes | Shape spec mapping field name to type. Types: "string", "number", "boolean", "array", "object". Suffix with "?" for optional. Example: { "name": "string", "age": "number", "tags": "array", "notes": "string?" } |