Skip to main content
Glama

get_run_occupancy

Read-onlyIdempotent

Count open threads by producer run id across channels to monitor one orchestrated run's nested work split into open, queued, claimed, working, and blocked states.

Instructions

Count the open threads that share one producer run id, as {parent_run_id, open, queued, claimed, working, blocked}: the split of get_channel_occupancy applied to every thread in your workspace whose lineage names that run, across channels. Use it to watch the nested work of one orchestrated run; attach the run id to a thread with set_thread_lineage and list those threads with list_run_threads. Counts only threads you may read and includes muted ones, and a run id that no thread uses returns zeros, not an error. Requires workspace:read.

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": {
      "parent_run_id": "<parent_run_id>"
    },
    "name": "get_run_occupancy"
  }
}

Input Schema

NameRequiredDescriptionDefault
parent_run_idYesThe producer's run identifier, exactly as it was stored on threads with set_thread_lineage. Surrounding whitespace is ignored; an empty value or one over 256 bytes is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv479.0.2
    • changedInput schema / properties / parent_run_id / description
      Previous value: -"the producer's run identifier"New value: +"The producer's run identifier, exactly as it was stored on threads with set_thread_lineage. Surrounding whitespace is ignored; an empty value or one over 256 bytes is refused."
  2. First observedv479.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description adds real context: counts include only threads the caller may read, muted threads are still counted, unknown run ids yield zeros rather than an error, and workspace:read is required. The only omission is whether results are paginated or paginated-by-channel, but for an aggregate-count tool over a single id this is close to complete.

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 with verb, resource, and return keys, then prerequisites, then edge-case behavior — no filler sentences. It is dense in places ('the split of get_channel_occupancy applied to every thread in your workspace whose lineage names that run, across channels'), which costs a little readability but not accuracy.

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?

With no output schema, the description carries the return contract itself by enumerating the keys {parent_run_id, open, queued, claimed, working, blocked}. Combined with the auth requirement, visibility rules, and zero-fill behavior, an agent has everything needed to call it and interpret the result.

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 coverage is 100%, so whitespace tolerance, empty-value rejection, and the 256-byte cap are already documented in the schema. The description adds provenance meaning (the id must be the value stored via set_thread_lineage and is the producer's run id), which is useful but modest given the schema already carries the validation rules.

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?

States a specific verb and resource ('count the open threads that share one producer run id') and even names the return shape. It explicitly positions itself as 'the split of get_channel_occupancy applied to every thread ... whose lineage names that run, across channels', which distinguishes it from the sibling by scope rather than leaving the agent to guess.

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 a concrete when-to-use case ('watch the nested work of one orchestrated run') and names the setup path: attach the run id with set_thread_lineage, then list threads with list_run_threads. It also states the fallback behavior (a run id no thread uses returns zeros, not an error), so an agent knows how to interpret an empty result instead of switching tools.

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

Deploy Server

Other Tools