Skip to main content
Glama

station_headways

Read-onlyIdempotent

Calculate train headways at a CTA station by direction for a line and time range from locally recorded positions, covering median, p90, max, bunching, and longest gaps; requires local recording.

Instructions

From locally recorded positions: time between trains passing a station per direction (median, p90, max, bunching, longest gaps). Needs chitransit record running on this machine.

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": {
      "station": "<station>",
      "line": "<line>"
    },
    "name": "station_headways"
  }
}

Input Schema

NameRequiredDescriptionDefault
lineYes'L' line.
sinceNo'90m', '24h', '7d' or an ISO time.24h
untilNoSame formats; default now.
stationYesStation name or map id.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, closed-world behavior, so the description only needs to add data-provenance context — and it does: results come from locally recorded positions and require `chitransit record` to be running on this machine. That prerequisite is the critical non-obvious behavior. It does not state what happens when the recorder has not been running or how far back local data extends, which is a remaining gap.

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?

Two sentences, front-loaded with the data source and no filler. The only minor redundancy is listing 'max' alongside 'longest gaps' and 'bunching', which are related metrics, making the enumeration slightly less crisp than it could be.

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?

An output schema exists, so return values need not be explained, and the description correctly spends its words on provenance and the runtime prerequisite. For a 4-parameter analytical tool the remaining gap is data-availability behavior when the local recorder has not been running.

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 100%, with formats for since/until and station/line already documented in the schema, so the baseline of 3 applies. The description adds the 'per direction' grouping dimension, which is not visible in the schema, but contributes nothing else about the parameters themselves.

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 gives a specific verb-plus-resource: it computes time between trains passing a station, per direction, and enumerates the metrics returned (median, p90, max, bunching, longest gaps). It clearly signals this is a derived-metrics tool rather than a live-arrivals tool, though it never names the sibling it contrasts with (e.g. train_arrivals).

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?

Usage context is implied by 'From locally recorded positions' and the prerequisite, so an agent can infer this is an offline/analytical query rather than a live lookup. However, there is no explicit when-to-use versus when-not, and no pointer to alternatives for live arrival data.

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