Skip to main content
Glama

See what the workers are doing

poll_workers

Track parallel worker status: get a compact table of all workers, then use a cursor to receive only new transitions and next steps, clean safe worktrees, and recover dead runs. Call in a loop.

Instructions

The main thread's read. Without cursor: a compact table of every worker and a next_cursor. With that cursor: only what happened since, as transitions (finished, failed, needs attention) with the next step; quiet when nothing did. A poll with a cursor also recovers a dead first run once and removes safe worktrees (listed under cleaned). Call it from a loop.

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": "poll_workers"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoRows in the full table, newest last
cursorNonext_cursor from the previous poll
statusNoFilter the full table

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so well: it discloses the delta-transition semantics, that the response is 'quiet when nothing did', that transition kinds include finished/failed/needs attention, and that a cursor poll has real side effects — recovering a dead first run once and removing safe worktrees (surfaced under 'cleaned'). The side-effect disclosure is especially valuable since no destructiveHint exists to warn the agent.

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 definition is short, front-loaded with the no-cursor case first, and nearly every clause carries information the agent needs (mode split, transition kinds, side effects). It is telegraphic to the point of fragmentary in places ('The main thread's read'), which slightly costs readability, but there is no padding.

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?

For a tool with no annotations and no output schema, the description adequately covers both return shapes (table plus next_cursor, transitions plus next step, cleaned) and the reuse-once recovery behavior. What remains unspecified is the field structure of a worker row and how the status filter interacts with cursor mode, but nothing an agent needs 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 100%, so the baseline is 3, but the description adds semantics the schema lacks: the cursor is a stateful delta token producing transitions rather than a pagination offset, which changes how the agent should interpret a follow-up call. It is less explicit about limit applying only to the full table (that detail lives in the schema) and does not explain the status filter's effect on delta mode.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — it reads the main thread's worker state — and clearly splits behavior by mode: no cursor returns 'a compact table of every worker and a next_cursor', a cursor returns 'only what happened since, as transitions'. The phrase 'The main thread's read' is slightly cryptic and doesn't directly name the sibling wait_workers, but the polling framing implicitly separates it from a blocking wait.

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?

'Call it from a loop' is an explicit usage directive that tells the agent this is a non-blocking poll rather than a one-shot blocking wait. The description also gives clear conditions for each mode (first poll without cursor for a full snapshot, subsequent polls with the returned cursor for deltas). It stops short of naming alternatives like wait_workers or describe_session, so there are no stated exclusions.

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