Skip to main content
Glama

Retry a failed job

retry_job

FREE when the original KIE task or a validated stored artifact can be recovered; otherwise PAID only for the sub-steps that still need to run. Re-runs the FAILED step of a job whose status is "error" — the prompt, model and every setting are already on the job, so this is the cheap way out of a failure instead of creating the whole thing again. Work that already succeeded is NOT redone or re-charged: a generation that failed after its image landed reuses the paid result. get_job reports retryMode, retryRecovery and retryCost, and the dryRun quote here is that same number. If get_job reports failureAction:"edit_input", do not use this tool; edit the prompt or references and create a new generation. A non-retryable phase answers 400 JOB_NOT_RETRYABLE — some late phases hold partially-committed state and deliberately have no blanket retry. Eligible overhead Material jobs use stored_artifact recovery to repair the original without new generation or background removal. A confirmed failed repair is not offered again by that processor; refresh get_job and honor server eligibility, even below the general two-attempt limit. No automatic refund is implied. Confirmed background-removal provider failures already fall back automatically on the server, without a new user charge. There is no daily removal retry lockout; honor reported cooldowns and unknown-task safeguards if recovery still fails. For already-authorized generation, automatically execute a zero-credit recovery quote and poll it; no renewed approval or refund. Never duplicate a running recovery. Limit automatic retries to two per failed job per session; stop on recurring failure or any paid quote. DEFAULTS TO A COST PREVIEW — see the dryRun argument. Returns { jobId } — poll get_job.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYesId of a job whose status is "error" (from get_job).
dryRunNoDEFAULTS TO TRUE. While true this returns only a cost quote ({ estimatedCredits, balance, spendCapDaily, spentLast24h, capRemaining }) and executes nothing. Show the user estimatedCredits, then ask a normal confirmation question. Prefer the client's native question UI with Approve / Decline / Discuss choices when available; otherwise accept any unambiguous conversational approval. Never require a fixed phrase or ask the user to type a magic word. Only after approval, re-call with dryRun:false to actually spend.
idempotencyKeyNoOptional Idempotency-Key for the real (dryRun:false) call. Omit and one is minted per call. Reuse the SAME value when retrying a call that failed with ENTITY_BUSY / 402 / 429 so the retry cannot double-dispatch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / dryRun / description
      Previous value: -"DEFAULTS TO TRUE. While true this returns only a cost quote ({ estimatedCredits, balance, spendCapDaily, spentLast24h, capRemaining }) and executes nothing. Show the user estimatedCredits and get an explicit yes for that amount, THEN re-call with dryRun:false to actually spend."New value: +"DEFAULTS TO TRUE. While true this returns only a cost quote ({ estimatedCredits, balance, spendCapDaily, spentLast24h, capRemaining }) and executes nothing. Show the user estimatedCredits, then ask a normal confirmation question. Prefer the client's native question UI with Approve / Decline / Discuss choices when available; otherwise accept any unambiguous conversational approval. Never require a fixed phrase or ask the user to type a magic word. Only after approval, re-call with dryRun:false to actually spend."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, the description discloses cost behavior (FREE vs PAID, no re-charge for completed work), dryRun defaulting to a cost preview, server-side fallback for background-removal failures, no automatic refund, and non-retryable 400 responses. This is far more behavioral context than the annotations alone provide, and nothing contradicts readOnlyHint/idempotentHint/destructiveHint.

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?

The description is long, but the tool has genuinely complex billing, recovery, and retry semantics; nearly every sentence carries operational information. It front-loads the core purpose and cost model, though a few points (e.g., dryRun default) restate schema content and the single-paragraph layout makes it harder to scan.

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

Completeness5/5

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

With no output schema, the description still states the return shape ({ jobId }) and tells the agent to poll get_job. It covers eligibility, cost, failure modes, idempotency, retry limits, and user-approval flow, so an agent has what it needs to invoke the tool correctly in both dryRun and real modes.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents jobId, dryRun, and idempotencyKey. The description adds value by explaining that the dryRun quote matches get_job's retryCost, that idempotencyKey reuse prevents double-dispatch on transient failures, and that dryRun defaults to a preview requiring user approval before spending.

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?

The description opens with a precise verb and resource: it re-runs the FAILED step of a job whose status is "error", and it distinguishes itself from creating a whole new generation. It also names the exact condition under which it should not be used (failureAction:"edit_input"), making its purpose unambiguous relative to siblings.

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

Usage Guidelines5/5

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

It gives explicit when-to-use criteria (error status, retryable phase, eligible recovery), an explicit when-not-to-use case (edit_input), and points to get_job for retryMode/retryRecovery/retryCost before calling. It also sets operational limits (two attempts per session, no duplicate running recovery) that govern invocation.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources