Skip to main content
Glama

claim_task

Destructive

CLAIMS a task ATOMICALLY so no other agent of the queue takes it at the same time: "to do" → "in progress" in ONE conditional write, the claim signed (agentLabel, otherwise your key's name; and the time). It replaces update_task({ status: "doing" }), which stops no one from taking the same task. taskId omitted = the FIRST ready task of the queue (priority, then position) — if another agent takes it in the same second, you get the next one. A selection (label, labels, labelsAny, labelsNone, cellId: the list_tasks filters, ANDed) narrows the queue to your perimeter, i.e. list_tasks({ executable: true, <selection> }); with taskId, a task outside it is refused (outside-selection). Response: { claimed: true, task } or { claimed: false, reason, message }; a refusal is never reported as a success. reason: not-found · already-claimed (with heldBy/heldAt when the claim was signed, null otherwise — a task set "in progress" by hand has no holder) · done · archived · blocked ("blocked" status set by hand) · open-dependencies (a dependency BLOCKS unless its prerequisite is done or a human decision LIFTED it: an ARCHIVED prerequisite not done still blocks. The refusal carries openDependencies, the ids of the blocking tasks archived ones included, and blockedBy, one entry per blocking dependency of either source with its state — open, target-archived (an archived task or cancelled plan nobody lifted: only a human decision frees the task, see list_tasks({ hasArchivedDependency: true })), or target-missing; the work graph is read on every claim, and if unreadable the call answers { error } and claims NOTHING) · arbitrage (an arbitration, a question to decide, is not work to claim: it follows its update_task.arbitrageAction cycle) · awaiting-validation / awaiting-approval (the task carries the LABEL a-valider / a-approuver: a human must validate or approve — it can neither be claimed nor reclaimed, EVEN if it is already "in progress"; these labels are not removed to claim the task: they are set and lifted by a human, and a status change through update_task is not a claim) · awaiting-triage (LABEL etat-tri:a-trier: awaiting triage — neither claimable nor listed by executable; the triage, per the project flow (the human or the designated agent), replaces the label with etat-tri:trie; evaluated AFTER done and already-claimed, which keep their reason) · plan-not-ready (the task carries the label plan: + the code of an existing work plan that does not hand it out: the plan is not pret or en-cours (planGate.why is plan-status), or waits on unsettled dependencies (plan-blocked, with planGate.blockedBy), or another identity leads it (plan-held: planGate.heldBy, planGate.leaseUntil; the holder passes its claim_work_plan agentName as agentLabel, and a subagent of the holder leaves the task to its orchestrator), or the task is not refined (task-unrefined, with planGate.missing); planGate.exit gives the way out: a string for a plan problem; for an unrefined task an update_task call ({ tool, params }, one step per missing thing, sent once its <…> placeholders are filled) or { humanOnly } when only a human can unblock it. A task of several plans is held back by the first plan (alphabetical order of codes) that does not hand it out. Judged after blocked, before open-dependencies. Tasks without a plan label are unaffected. Guidance for the claim protocol, not a lock: an agent that writes can still set a task to doing with update_task) · no-ready-task (without taskId: no ready task; blockedByArchivedDependency: N = how many are not ready ONLY because a prerequisite is archived and not lifted, blockedByPlanGate: N how many a work plan holds back, outsideSelection: N ready tasks outside your selection, each absent when 0) · conflict (the row changed during the claim: a re-read then a retry settle it) · write-locked (agent writes are LOCKED on this block or project for this account: message says what to unlock — without taskId, tasks of a locked view are skipped). A refusal writes NOTHING. Claiming a CHILD task of an arbitration already DECIDED (step arbitre) STARTS it in your name — startedBy/startedAt, and startedArbitrages in the response, absent otherwise: carry out a decision through CHILD tasks of the arbitration, not through tasks that DEPEND on it (a dependent task cannot be claimed before its closure). update_task({ arbitrageAction: { type: "start" } }) remains allowed. A claimed task leaves list_tasks({ executable: true }). Handing a task back: update_task({ status }). A task marked executor: "human" is refused with human-task (evaluated AFTER done and already-claimed) and is left out of executable: an agent does not take a human's task. LEASE: a claim is a LEASE of 15 minutes. The response carries claimToken (a SECRET identifying you as holder, kept out of every written text), leaseUntil (the deadline) and leaseMinutes. Past the deadline the task is claimable again on the same terms as a task to do: every refusal above applies (plan-held included), a caller the gate admits takes it over (claimed: true with reclaimed: { reason: "lease-expired", previousHolder, expiredAt }: a TAKEOVER, not a refusal), and list_tasks({ executable: true }) lists it for that caller. already-claimed then also carries leaseUntil. One connection plus one agentLabel is ONE holder: its live claim named by taskId is retaken with a NEW token, the old one dies (reclaimed.reason: "same-holder"; a concurrent twin gets conflict, then wins on retry), so agents sharing a connection each need their own agentLabel (none, or your key's name: no reprise). The plan gate still judges that retake: under a plan another identity holds, it is refused (plan-held). A task set "in progress" by hand (no signed claim) has no deadline. RENEW with renew_claim (at least once per lease, DECLARING your progress). During the lease, any agent write on the task (update_task, archive_task, unarchive_task) requires claimToken: without it CLAIM_HELD, with an expired token CLAIM_LOST. The token does NOT cover the tracking of the implementation plan (impl-2026-10-* tasks), which this tool never "claims": no claim, no token. REMOVAL: a human can REMOVE your claim ("Take the task back"): the task returns to "to do", your writes on it are refused (CLAIM_REMOVED, with or without a token) and your key cannot reclaim it — claim_task answers claim-removed — until a human hands it back to you. A human can also ASK you to stop: read stop[] (reason stop_requested) in get_contextual_updates and hand back your claim with a progress report.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "claim_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelNoAs `list_tasks.label`.
cellIdNoAs `list_tasks.cellId`.
labelsNoAs `list_tasks.labels`.
taskIdNoThe task to CLAIM. Omitted, the FIRST ready task of the queue (of your selection) — "my next task".
labelsAnyNoAs `list_tasks.labelsAny`.
agentLabelNoThe label that SIGNS the claim ("agent-doc", "worker-2"…) — what another agent reads in the refusal "already claimed by …". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, e.g. in the chat, no label: `claimedBy: null`). Two agents of the same key sign the same way: `agentLabel` tells them apart once several agents share a queue. Omitted, the call is never the holder of a work plan: the tasks of a plan you hold are claimed with its claim_work_plan `agentName` as `agentLabel`.
labelsNoneNoAs `list_tasks.labelsNone`.
expectedProjectIdNoUUID of the project THIS call targets (overrides the session project).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / agentLabel / description
      Previous value: -"The label that SIGNS the claim (\"agent-doc\", \"worker-2\"…) — what another agent reads in the refusal \"already claimed by …\". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, e.g. in the chat, no label: `claimedBy: null`). Two agents of the same key sign the same way: `agentLabel` tells them apart once several agents share a queue."New value: +"The label that SIGNS the claim (\"agent-doc\", \"worker-2\"…) — what another agent reads in the refusal \"already claimed by …\". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, e.g. in the chat, no label: `claimedBy: null`). Two agents of the same key sign the same way: `agentLabel` tells them apart once several agents share a queue. Omitted, the call is never the holder of a work plan: the tasks of a plan you hold are claimed with its claim_work_plan `agentName` as `agentLabel`."
  2. Changed6 schema fields changed
    • addedInput schema / properties / cellId
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 200,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "As `list_tasks.cellId`."
      +}
    • addedInput schema / properties / label
      Added value: +{
      +  "description": "As `list_tasks.label`.",
      +  "maxLength": 60,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / labels
      Added value: +{
      +  "description": "As `list_tasks.labels`.",
      +  "items": {
      +    "maxLength": 60,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • addedInput schema / properties / labelsAny
      Added value: +{
      +  "description": "As `list_tasks.labelsAny`.",
      +  "items": {
      +    "maxLength": 60,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • addedInput schema / properties / labelsNone
      Added value: +{
      +  "description": "As `list_tasks.labelsNone`.",
      +  "items": {
      +    "maxLength": 60,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • changedInput schema / properties / taskId / description
      Previous value: -"The task to CLAIM. Omitted, the FIRST ready task of the queue is claimed (same definition as `list_tasks({ executable: true })`, by priority then position) — the \"my next task\" action."New value: +"The task to CLAIM. Omitted, the FIRST ready task of the queue (of your selection) — \"my next task\"."
  3. Changed1 schema field changed
    • changedInput schema / properties / expectedProjectId / description
      Previous value: -"UUID of the project THIS call targets (overrides the session project). No access: refused, nothing changed."New value: +"UUID of the project THIS call targets (overrides the session project)."
  4. Changed2 schema fields changed
    • changedInput schema / properties / agentLabel / description
      Previous value: -"The label that SIGNS the claim (\"agent-doc\", \"worker-2\"…) — it is what another agent will read in the refusal \"already claimed by …\". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, in the chat for example, it stays without a label: `claimedBy: null`). Two agents of the same key therefore sign the same way: `agentLabel` serves to tell them apart as soon as several agents share a queue."New value: +"The label that SIGNS the claim (\"agent-doc\", \"worker-2\"…) — what another agent reads in the refusal \"already claimed by …\". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, e.g. in the chat, no label: `claimedBy: null`). Two agents of the same key sign the same way: `agentLabel` tells them apart once several agents share a queue."
    • changedInput schema / properties / expectedProjectId / description
      Previous value: -"UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted."New value: +"UUID of the project THIS call targets (overrides the session project). No access: refused, nothing changed."
  5. Changed3 schema fields changed
    • changedInput schema / properties / agentLabel / description
      Previous value: -"Le libellé qui SIGNE la prise (« agent-doc », « worker-2 »…) — c’est lui qu’un autre agent lira dans le refus « déjà prise par … ». Facultatif : omis, la prise est signée du NOM DE LA CLÉ d’API de l’appel (sans clé nommée, dans le chat par exemple, elle reste sans libellé : `claimedBy: null`). Deux agents d’une même clé signent donc pareil : `agentLabel` sert à les distinguer dès que plusieurs agents partagent une file."New value: +"The label that SIGNS the claim (\"agent-doc\", \"worker-2\"…) — it is what another agent will read in the refusal \"already claimed by …\". Optional: omitted, the claim is signed with the NAME OF THE API KEY of the call (without a named key, in the chat for example, it stays without a label: `claimedBy: null`). Two agents of the same key therefore sign the same way: `agentLabel` serves to tell them apart as soon as several agents share a queue."
    • changedInput schema / properties / expectedProjectId / description
      Previous value: -"UUID du projet visé par CET appel. Cible RÉELLEMENT ce projet au lieu du projet de session. Refusé sans rien modifier si l'accès n'est pas accordé."New value: +"UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted."
    • changedInput schema / properties / taskId / description
      Previous value: -"La tâche à PRENDRE. Omis, c’est la PREMIÈRE tâche prête de la file qui est prise (même définition que `list_tasks({ executable: true })`, par priorité puis position) — le geste « ma prochaine tâche »."New value: +"The task to CLAIM. Omitted, the FIRST ready task of the queue is claimed (same definition as `list_tasks({ executable: true })`, by priority then position) — the \"my next task\" action."
  6. Changed2 schema fields changed
    • changedInput schema / properties / agentLabel / description
      Previous value: -"Le libellé qui SIGNE la prise (« agent-doc », « worker-2 »…) — c’est lui qu’un autre agent lira dans le refus « déjà prise par … ». Facultatif : omis, la prise est signée du NOM DE LA CLÉ d’API de l’appel (sans clé nommée, dans le chat par exemple, elle reste sans libellé : `claimedBy: null`). Deux agents d’une même clé signent donc pareil : pose `agentLabel` dès que plusieurs agents partagent une file, pour qu’on les distingue."New value: +"Le libellé qui SIGNE la prise (« agent-doc », « worker-2 »…) — c’est lui qu’un autre agent lira dans le refus « déjà prise par … ». Facultatif : omis, la prise est signée du NOM DE LA CLÉ d’API de l’appel (sans clé nommée, dans le chat par exemple, elle reste sans libellé : `claimedBy: null`). Deux agents d’une même clé signent donc pareil : `agentLabel` sert à les distinguer dès que plusieurs agents partagent une file."
    • changedInput schema / properties / taskId / description
      Previous value: -"La tâche à PRENDRE. OMIS = prends la PREMIÈRE tâche prête de la file (même définition que `list_tasks({ executable: true })`, par priorité puis position) — c’est le geste « donne-moi ma prochaine tâche »."New value: +"La tâche à PRENDRE. Omis, c’est la PREMIÈRE tâche prête de la file qui est prise (même définition que `list_tasks({ executable: true })`, par priorité puis position) — le geste « ma prochaine tâche »."
  7. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only supply readOnlyHint=false and destructiveHint=true; the description goes far beyond by disclosing the lease model (15 minutes, `claimToken`, `leaseUntil`), the full refusal taxonomy with reasons, that refusals write nothing, that claims are advisory not locks, and the write-lock/CLAIM_HELD/CLAIM_REMOVED consequences. This is exactly the behavioral context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded, but the text then runs to roughly a thousand words in one dense paragraph with nested parentheses covering every refusal code, lease edge case, and plan-gate permutation. Much of this is genuinely useful, but the lack of structure and sheer volume makes it hard to scan and expensive to carry in context.

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?

For a mutation tool with no output schema and eight optional parameters, the description covers return shape (`{ claimed, task }` vs `{ claimed: false, reason, message }`), every refusal reason and its extra fields, the lease lifecycle, and the takeover path. Nothing an agent needs in order to call it correctly is missing.

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 already 100%, so the schema documents each parameter. The description still adds meaning: that selection filters are ANDed like `list_tasks`, that a taskId outside the selection is refused as `outside-selection`, and how `agentLabel` interacts with plan holds and key naming. Useful surplus, though partly duplicating the schema's own prose.

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?

Opens with a precise verb+resource+mechanism: 'CLAIMS a task ATOMICALLY ... in ONE conditional write', and immediately distinguishes itself from the sibling `update_task({ status: "doing" })`, which it explicitly says 'stops no one from taking the same task.' An agent can tell exactly what this does and why it differs from the nearest alternative.

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?

Explicitly states when to use it (atomic claim of a ready task, with or without taskId), when not to (arbitrage items, human-executor tasks, awaiting-validation/approval/triage labels, impl plan tracking tasks), and which alternatives handle those cases (`update_task`, `renew_claim`, `claim_work_plan`, `get_contextual_updates` stop[]). The when/when-not routing is unusually complete.

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.