Skip to main content
Glama

claim_work_plan

Destructive

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

NameRequiredDescriptionDefault
phaseYes`execute` (a ready plan) or `refine` (a plan with tasks to refine).
planCodeNoThe code of the plan, as `list_work_plans` returns it.
agentNameYesYour agent name (at most 200 characters): with your connection, it identifies the holder.
machineNameNoYour machine, declared (at most 100 characters).
subagentCountNoYour subagents, declared (0 to 1000).
expectedProjectIdNoUUID of the project THIS call targets (overrides the session project).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say it is a non-readonly, destructive, closed-world write; the description adds the real behavioral surface: holder identity = connection AND agentName, idempotent re-claim returning the live claim with a fresh token, a 15-minute lease renewed every 10 minutes, re-claimability after expiry, and that refusals write nothing. It also discloses that `claimToken` is a secret returned only here, which is critical handling context no annotation conveys.

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

Conciseness4/5

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

Front-loaded and dense with semicolon-delimited clauses that map to distinct concerns (scoping, holder, lease, response, refusals, failures). The exhaustive enumeration of fourteen refusal codes plus three failure codes and a protocol URI is close to a wall of tokens, though each entry is actionable for error handling rather than filler.

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?

There is no output schema, but the description inlines the success shape `{ claimed, plan, claimToken, leaseUntil, renewEveryMinutes, reclaimed?, stopRequested? }` and the error shape `{ code, error }`, plus lease timing and the agent-loop protocol reference. For a six-parameter exclusive-claim tool, nothing an agent needs to call or recover 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 100%, so the baseline is 3, but the description genuinely adds meaning: it explains what omitting `planCode` does (queue default), how `agentName` combines with the connection to form the holder identity, and why `expectedProjectId` matters via the NO_PROJECT_TARGETED / PROJECT_OUT_OF_KEY_SCOPE refusals. `machineName` and `subagentCount` are left to the schema, which is acceptable at full coverage.

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 specific verb and resource ("CLAIMS a work plan") and immediately scopes it: one orchestrator per plan, tasks claimed by the holder only. It also explicitly separates itself from claim_task ("The plan and its tasks do not change: claim_task claims tasks") and from list_work_plans, so an agent can pick correctly without opening a schema.

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?

Gives explicit conditional usage: with `planCode` you claim that plan, without it you take the first claimable entry of the `list_work_plans({ phase })` queue. It names the paired alternatives renew_work_plan_claim (lease upkeep), release semantics via expiry, and claim_task (task-level claiming), so both when-to-use and when-not-to-use are covered.

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.