retry
Execute a prompt with automatic retries on failure, validating output type if specified and using prior error context for each retry.
Instructions
Run a single agent with automatic retries on failure.
If declared_type is set, retries until the output validates as that type (not just until exit code 0). Each attempt receives the prior error as context.
Args: prompt: The task prompt. max_attempts: Maximum number of attempts (default: 3). sandbox: Named sandbox spec or inline JSON. model: Claude model (default: sonnet). timeout: Timeout per attempt (default: 120). declared_type: If set, validates output and retries if not VALID. mcps: JSON array of MCP server names to attach.
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": {
"prompt": "<prompt>"
},
"name": "retry"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| max_attempts | No | ||
| sandbox | No | ||
| model | No | sonnet | |
| timeout | No | ||
| declared_type | No | ||
| mcps | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |