claim_work_plan
CLAIMS a work plan. One orchestrator per plan: the tasks of a held plan are claimed by its holder only. Without planCode: the first claimable plan of the list_work_plans({ phase }) queue. Holder: your connection (API key or account) AND agentName; claiming again, the same holder gets its live claim back with a new token. Lease: 15 minutes, renewed every 10 by renew_work_plan_claim; expired, the plan can be claimed again (the refusals below apply, PLAN_CLAIM_WITHDRAWN included). Response: { claimed: true, plan, claimToken, leaseUntil, renewEveryMinutes, reclaimed?, stopRequested? }; claimToken is a secret returned only here. Refusals { code, error }, nothing written: PLAN_NOT_FOUND, PLAN_NOT_READY, NO_PLAN_IN_QUEUE, NO_CLAIMABLE_PLAN, PLAN_CLAIM_HELD (heldBy), PLAN_CLAIM_WITHDRAWN, PLAN_CLAIM_LOST, AGENT_NAME_REQUIRED, WORK_GRAPH_UNREADABLE, NO_PROJECT_TARGETED, CONNECTION_REQUIRED, WRITE_ACCESS_REQUIRED, PROJECT_OUT_OF_KEY_SCOPE, WRITE_LOCKED, PLAN_CLAIM_INVALID. Failures: STORAGE_ERROR, STORAGE_UNREADABLE, INVALID_INSTANT. The plan and its tasks do not change: claim_task claims tasks. Protocol: orggen://integrations/agent-loop.
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": {
"phase": "<phase>",
"agentName": "<agentName>"
},
"name": "claim_work_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phase | Yes | `execute` (a ready plan) or `refine` (a plan with tasks to refine). | |
| planCode | No | The code of the plan, as `list_work_plans` returns it. | |
| agentName | Yes | Your agent name (at most 200 characters): with your connection, it identifies the holder. | |
| machineName | No | Your machine, declared (at most 100 characters). | |
| subagentCount | No | Your subagents, declared (0 to 1000). | |
| expectedProjectId | No | UUID of the project THIS call targets (overrides the session project). |