Skip to main content
Glama

claim_task

Claim a task for a worker, preventing claims on adjacent tasks in the same project to uphold peer verification.

Instructions

Claim an available task for a worker.

Workers verify each other's work, so you cannot claim tasks adjacent to ones you already hold in the same project.

Args: task_id: The task ID to claim. worker_id: Your worker ID on RobotFail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes
worker_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The claim_task tool handler: an async MCP tool that claims an available task for a worker by POSTing to /api/tasks/{task_id}/claim with the worker_id.
    @mcp.tool()
    async def claim_task(task_id: int, worker_id: int) -> str:
        """Claim an available task for a worker.
    
        Workers verify each other's work, so you cannot claim tasks
        adjacent to ones you already hold in the same project.
    
        Args:
            task_id: The task ID to claim.
            worker_id: Your worker ID on RobotFail.
        """
        data = await _post(f"/api/tasks/{task_id}/claim", {"worker_id": worker_id})
        return json.dumps(data, indent=2)
  • The @mcp.tool() decorator registers claim_task as an MCP tool.
    @mcp.tool()
  • The function signature defines the input schema: task_id (int) and worker_id (int). The return type is str.
    async def claim_task(task_id: int, worker_id: int) -> str:
        """Claim an available task for a worker.
    
        Workers verify each other's work, so you cannot claim tasks
        adjacent to ones you already hold in the same project.
    
        Args:
            task_id: The task ID to claim.
            worker_id: Your worker ID on RobotFail.
        """
        data = await _post(f"/api/tasks/{task_id}/claim", {"worker_id": worker_id})
        return json.dumps(data, indent=2)
  • The _post helper function used by claim_task to make HTTP POST requests to the RobotFail API.
    async def _post(path: str, body: dict = None) -> dict:
        async with httpx.AsyncClient(timeout=60) as client:
            r = await client.post(f"{API_BASE}{path}", headers=_headers(), json=body or {})
            r.raise_for_status()
            return r.json()
Behavior3/5

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

Without annotations, the description bears the burden of behavioral disclosure. It reveals the adjacency constraint and the action, but does not specify side effects, permissions, error conditions, or result format. Some behavioral context is provided, but gaps remain.

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?

The description is concise with four sentences, including an args list. It front-loads the main purpose. There is no extraneous text, but the args list could be more integrated. Overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 required params, no annotations, output schema present), the description covers the core action and a key constraint. It omits prerequisites like task availability, but the output schema can cover return info. Adequate for the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides basic semantics for each parameter: task_id as 'the task ID to claim' and worker_id as 'your worker ID on RobotFail'. This adds some meaning but lacks details like valid ranges or how to obtain IDs.

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 clearly states the action 'Claim an available task for a worker' with a specific verb and resource. It distinguishes from sibling tools like 'list_available_tasks' or 'submit_task' by focusing on claiming. The unique adjacency constraint further differentiates it.

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

Usage Guidelines3/5

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

The description implies when to use (claiming a task) and provides a constraint (no adjacent tasks). However, it does not explicitly state when not to use it or compare to alternatives like 'submit_task'. The guidance is implicit but not comprehensive.

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/guinevere-kingsley/robotfail-mcp'

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