Skip to main content
Glama

Claim task(s)

claim_task

Claim the next queued task for a worker, ensuring each task is handled by exactly one consumer. Use count to fetch multiple tasks and leaseMs to set a custom lease time.

Instructions

Claim the next task(s) off a queue for worker (competing consumers — each task goes to exactly one claimer). An empty queue returns {tasks:[]} (not an error). Each returned task carries a fencingToken and visibilityDeadline — keep them: ack/nack/extend need the token, and the task returns to the queue if you do not ack/extend before the deadline. count prefetches several; leaseMs overrides the task default lease.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoprefetch up to N tasks (default 1)
queueYes
workerYesa stable id for this worker (appears in the task as claimedBy)
leaseMsNolease length; omit to use the task default
Behavior5/5

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

With no annotations, the description fully discloses key behaviors: empty queue returns {tasks:[]} not an error, returned tasks include fencingToken and visibilityDeadline, token required for ack/nack/extend, and tasks return to queue if not acked/extended before deadline. This goes far beyond a simple action statement.

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

Conciseness5/5

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

The description is compact (three sentences) and front-loads the main action. Each sentence adds a distinct piece of information without redundancy, covering behavior, return values, and parameter semantics efficiently.

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?

Given the lack of an output schema, the description sufficiently explains the return shape (empty array or tasks with fencingToken/visibilityDeadline) and the lease mechanism. It covers the important edge case of an empty queue and the lifecycle dependency on ack/extend, making it complete for the tool's complexity.

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?

The schema documents worker, count, and leaseMs (but not queue). The description adds meaning beyond the schema: count prefetches several tasks, leaseMs overrides the task default lease, and worker is the claimant appearing as claimedBy. This adds value for the ambiguous parameters.

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?

The description uses a specific verb 'Claim' with a specific resource 'task(s) off a queue' and clearly differentiates from sibling tools like enqueue_task, ack_task, and list_tasks by emphasizing the competing-consumer semantics. It tells exactly what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states the competing-consumer pattern ('each task goes to exactly one claimer') and provides guidance on when to use count and leaseMs. It does not explicitly exclude alternatives like get_task or list_tasks, but the context makes the intended use clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eyalm321/hyperpanes-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server