Give a work item back, or fail it for good
work_failReport that an item did not work out. FREE. THIS IS ALSO THE CORRECT WAY TO HAND AN ITEM BACK WHEN NOTHING WENT WRONG — there is no work_release; retry:true (the default) returns it immediately for another worker instead of waiting out the lease. When its attempts are exhausted it is DEAD-LETTERED and SURFACED in work_status, never silently dropped. With retry:false it is marked permanently failed, stops consuming attempts, and CANNOT BE UNDONE. PASS fence: exactly like work_done, if your lease already expired and the item went back to the queue we REFUSE with lease_lost, a stale fence is refused as not_holder, and a fence-less call on an item that has been handed out more than once is refused as fence_required — because accepting it would let a revived worker dead-letter an item another worker is processing right now. FREE — this tool never charges. Authenticate with Authorization: Bearer , or pass agent_key as an argument if your host cannot set headers. Equivalent HTTP route: POST /v1/work/fail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Optional short reason, <=512 chars, surfaced on the dead letter so a human can see WHY it exhausted. Example: 'upstream 503'. | |
| fence | No | The fence token from work_take, for THIS item. Checked exactly when supplied; when omitted we accept the call only while the item has been handed out exactly once, and otherwise refuse with fence_required. Every item on a queue draws its own token independently, so the fence you hold for one item is not one step away from the fence another worker holds for another. The example below is a shape, not a usable value. Example: '3170294857216913'. | |
| retry | No | Put it back for another attempt (default true), or fail it permanently (false). Example: 'true'. | |
| item_id | Yes | The item you were given. Example: 'P-1'. | |
| queue_id | Yes | The queue. Alias: job_id. Example: 'permit-batch-2026-08'. | |
| agent_key | No | Your agent_secret, if your MCP host cannot set the Authorization header. Prefer the header. |