Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
max_attemptsNo
sandboxNo
modelNosonnet
timeoutNo
declared_typeNo
mcpsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses key behavioral traits: retries on failure, prior error as context, type validation retry logic. Lacks details on final failure behavior, side effects, or idempotency. With no annotations, description is decent but not fully comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose stated upfront, followed by a bullet-like Args list. No redundant sentences, but could be slightly more concise by integrating defaults inline.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers main functionality but omits behavior after all retries exhausted, error handling, and does not reference output schema. For a 7-param tool with output schema, more completeness is expected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but description provides brief explanations for each parameter, e.g., 'The task prompt' for prompt. Adds some meaning but lacks detail on constraints or formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool runs a single agent with automatic retries on failure, and explains the type validation retry condition. Distinguishes from siblings like 'run' (no retries) and 'chain' (multiple agents).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context for usage: when retries are needed or type validation is desired. However, does not explicitly state when not to use or compare to alternatives like 'run' or 'beam'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stiege/swarm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server