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.
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 |