claim_next_workspace_thread
Claims the next available work item across all readable workspace channels in one call, with optional filters and waiting. Returns the claimed thread and lease ID, or null if none is claimable.
Instructions
Claim the next piece of work across every channel of your workspace that you may read, in one call: the same selection, filters, lease and result as claim_next_thread, without the channel argument. Use claim_next_thread to draw from one channel only, claim_thread to take one thread by id, and get_workspace_queue_depth to count ready work before you ask. With wait_ms set and nothing claimable it holds the call open until work becomes claimable and claims it, so a worker needs no polling loop. A private channel's threads go only to its members and a DM's only to its participants. Returns the thread with its claim_lease_id, attributes and pin {uri, content_hash}, or null when nothing is claimable or you are at the workspace's work-in-progress limit. Requires thread:transition.
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": {
"workspace_id": "<workspace_id>"
},
"name": "claim_next_workspace_thread"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | only claim a thread of this kind (change, plan or review; a thread that names no kind is a change). A review seat claims with kind review and its repo, and no engine, to take every review in that repository whatever engine wrote the change. Combines with repo, engine and lane. Omitted, any kind | |
| lane | No | the service lane this worker runs in; lane breaks ties, never filters: among threads of equal priority and wait, threads in this lane come first, then unlaned ones, then other lanes. Omitted, unlaned threads win the tie | |
| repo | No | only claim a thread whose footprint names this repository (owner/name or a GitHub clone URL), or a review whose repo attribute names it, for a worker whose checkout is that repository; any other thread without a footprint is then never claimed. Omitted, any work | |
| engine | No | only claim a thread routed to this engine, for a worker that serves one kind of work; a thread routed to another engine, or not routed at all, is then never claimed. Omitted, any work | |
| wait_ms | No | with nothing claimable, wait up to this long for work to become claimable (a new thread, a dependency finishing, a claim released or expiring) and claim it, instead of answering null at once. The claimant's wake-up: no polling loop. Omitted or 0, one try | |
| lease_secs | No | lease in seconds (1 s to 7 days); renew before it lapses, or the thread is reaped and returns to the queue with a ClaimExpired. Omitted, the server's default lease applies (MAIDAN_CLAIM_DEFAULT_LEASE_SECS, 600 s) | |
| workspace_id | Yes | your own workspace (whoami's workspace_id) |