validate_response
Validates parsed JSON against a shape spec to enforce structured output. Returns validation result with human-readable error for retry feedback.
Instructions
Validate a parsed JSON value against an agentcast shape spec. Spec maps field name to type: 'string', 'number', 'boolean', 'array', 'object'. Suffix with '?' for optional. Returns valid=true on success, or valid=false with a human-readable error string suitable for retry feedback.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"value": "<value>",
"shape": "<shape>"
},
"name": "validate_response"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shape | Yes | Shape spec: { fieldName: 'string' | 'number' | 'boolean' | 'array' | 'object', ... }. Append '?' for optional fields, e.g. { name: 'string', age: 'number?' }. | |
| value | Yes | The parsed JSON value to validate (any shape). |