Fail Contract
fail_contractMarks a claimed contract as terminally failed with a mandatory reason, recording status and completion time for requester visibility.
Instructions
Explicitly mark a CLAIMED contract as terminal FAILED with a mandatory failure reason.
Behavior & Side Effects
Destructive terminal transition: Sets status='FAILED', error_reason='WORKER_FAILED: ', and completed_at=nowMs.
Return Value
Returns { ok, contract_id, status: 'FAILED' | 'TIMED_OUT', remediation?, message }.
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": {
"contract_id": "<contract_id>",
"reason": "<reason>"
},
"name": "fail_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | Mandatory explanation of why the task cannot be completed. Stored in error_reason for the requester. | |
| agent_id | No | Current holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var). | |
| claim_token | No | Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301). | |
| contract_id | Yes | The CLAIMED contract ID to mark as terminal FAILED. |