Skip to main content
Glama

tods-mcp 🚌

Transit Operational Data Standard (TODS v2.1.0) Model Context Protocol (MCP) server, validator, supplement merge engine, and interactive CLI.

Standardized by MobilityData, TODS extends public GTFS to represent the internal operational reality of transit systems: crew run cuts, pieces of work, driver reliefs, deadheads / yard moves, and dated vehicle block rosters.

tods-mcp connects LLMs (Antigravity, Claude Desktop, Cursor, Claude Code) and developers directly to transit operations datasets.


🚀 Features

  • ⚡ Official Supplement Merge Engine: Executes the TODS v2.1.0 supplement overlay algorithm (_supplement.txt on GTFS files) with support for row updates, insertions, and TODS_delete=1 removals.

  • 🩺 Automated Validator: Checks primary key uniqueness, foreign key consistency against supplemented tables, temporal continuity (start_time <= end_time), and ensures operators are never scheduled for overlapping trips.

  • 🧑‍✈️ Crew Run Inspector: Decodes run_events.txt into chronological duties (report, clear, deadhead, trips, breaks, reliefs) with duty hour calculations.

  • 🚍 Fleet & Block Assignments: Queries physical fleet rosters and vehicle assignments to blocks by service date.

  • 🤖 Built-in Agent Skill (SKILL.md): Complete agent guide included for authoring and reasoning about TODS feeds.

  • 🖥️ Dual Mode: Runs as an MCP server via stdio or as an interactive CLI utility (inspect, validate, merge, runs).


Related MCP server: bus-scheduling-mcp

📦 Installation & CLI Usage

Build from source

git clone https://github.com/amin/tods-mcp.git # or local folder
cd tods-mcp
npm install
npm run build

Inspect a feed

node dist/index.js inspect ./test/fixtures/sample-tods-feed
# Or if installed globally / linked:
tods inspect ./path/to/feed.zip

Validate a feed

node dist/index.js validate ./test/fixtures/sample-tods-feed

View effective supplement merge diffs

node dist/index.js merge ./test/fixtures/sample-tods-feed --table stops.txt

List crew runs

node dist/index.js runs ./test/fixtures/sample-tods-feed

🛠️ MCP Tools Reference

Tool

Parameters

Description

tods_inspect_feed

feed_path

High-level audit of GTFS base rows, supplement tables, crew runs, and vehicle counts.

tods_merge_supplements

feed_path, table_name?, sample_limit?

Merges supplement files onto GTFS base tables and provides diffs of added, modified, and deleted rows.

tods_validate_feed

feed_path

Validates primary/foreign keys, non-overlapping trip assignments, and time integrity.

tods_get_runs

feed_path, run_id?, service_id?, piece_id?

Returns chronological events for crew runs including duty durations and relief handoffs.

tods_get_vehicle_assignments

feed_path, date?, block_id?, vehicle_id?

Returns fleet vehicle assignments mapped to vehicle blocks.

tods_get_deadheads

feed_path

Lists non-revenue positioning trips, yard pulls, and depot moves.


⚙️ MCP Configuration

Add to your mcp_config.json (Claude Desktop, Antigravity, Cursor, etc.):

{
  "mcpServers": {
    "tods-mcp": {
      "command": "node",
      "args": ["E:/development/tods-mcp/dist/index.js", "serve"]
    }
  }
}

📄 License

MIT © Amin

Available Tools

6 tools
tods_get_deadheadsC

Extracts deadheads, yard pulls, non-revenue positioning trips, and depot movements identified in trips_supplement.txt or run_events.txt.

ParametersJSON Schema
NameRequiredDescriptionDefault
feed_pathYesPath to local directory or .zip containing the TODS dataset.

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries full behavioral burden. It says what is extracted but does not disclose read-only nature, side effects, return format, error handling, or any operational traits needed to call it confidently.

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?

A single sentence, front-loaded with the action verb and entity list. It is appropriately sized with no obvious filler, though the list could be slightly clearer with separators.

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

Completeness3/5

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

For a one-parameter getter with a fully documented schema but no output schema or annotations, the description identifies the extracted entity types and source files. It does not explain return values or how the output is structured, leaving a gap for an extraction tool.

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 the single feed_path parameter is already documented. The description adds domain context by naming the source files it reads from, but adds no syntax or format details beyond the schema.

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?

States a specific verb ('Extracts') and concrete resource types: deadheads, yard pulls, non-revenue positioning trips, and depot movements. It clearly differentiates from generic run or vehicle assignment tools, though it does not explicitly name siblings.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, and no exclusions or prerequisites. The mention of source files (trips_supplement.txt or run_events.txt) implies a narrow context but does not tell an agent when to choose this over tods_get_runs or others.

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

tods_get_runsA

Queries operational crew runs from run_events.txt. Returns chronological duty events, report/clear times, pieces of work, and total duty duration.

ParametersJSON Schema
NameRequiredDescriptionDefault
run_idNoOptional filter by specific run_id (e.g. "Run101").
piece_idNoOptional filter by piece_id.
feed_pathYesPath to local directory or .zip containing the TODS dataset.
service_idNoOptional filter by service_id (e.g. "weekday").

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully declares the returned content (chronological duty events, report/clear times, work pieces, total duty duration), which substitutes for an absent output schema, but it omits read-only/mutating status and any behavior on missing runs or malformed feeds.

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?

Two tight sentences with zero filler; the data source is front-loaded and the return payload follows immediately. Nothing is wasted.

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

Completeness3/5

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

For a 4-parameter query tool with no annotations and no output schema, the description covers the return shape well but never mentions the filtering capability that the three optional parameters imply, leaving a gap an agent would need to discover from the schema.

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%, so all four parameters (including the three optional filters) are already documented in the schema. The description adds no additional meaning about filter semantics or combinations, so the baseline 3 applies.

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 (queries) and resource (operational crew runs from run_events.txt), and enumerates what is returned (duty events, report/clear times, pieces of work, duty duration). This is clearly separable from siblings like tods_get_deadheads or tods_get_vehicle_assignments.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over tods_get_deadheads or tods_get_vehicle_assignments, nor any prerequisites beyond the implicit need for a feed. Usage must be inferred entirely from the tool name and data source mention.

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

tods_get_vehicle_assignmentsC

Queries fleet vehicle assignments to blocks and dates from vehicle_assignments.txt and vehicles.txt.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNoOptional filter by date (YYYYMMDD).
block_idNoOptional filter by block_id.
feed_pathYesPath to local directory or .zip containing the TODS dataset.
vehicle_idNoOptional filter by vehicle_id.

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, and it discloses little. It implies a read-only query over local files but says nothing about permissions, error behavior when files are missing, filter-combination semantics, or what the result looks like. Naming the two source files is the only added behavioral signal.

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?

A single efficient sentence with the resource and data source front-loaded and zero filler. It is arguably too terse rather than padded, but nothing in it is wasted.

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

Completeness3/5

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

With four parameters and no output schema, the description should ideally indicate what a query returns (assignment records? counts?) and whether feed_path must point at a directory or zip. The schema covers the parameter side, but the return-value gap leaves it only minimally complete.

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%, so every parameter is already documented in the schema, making 3 the baseline. The description reiterates date/block filtering but adds no format, syntax, or combination guidance beyond the schema's '(YYYYMMDD)' note.

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?

States a specific verb (queries) and resource (fleet vehicle assignments to blocks and dates) and even names the source files, so the agent knows it reads assignment data. It does not explicitly distinguish itself from siblings like tods_get_runs or tods_get_deadheads, which also appear to be feed-reading tools, so a 4 rather than a 5.

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

Usage Guidelines2/5

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

There is no statement of when to reach for this tool versus tods_get_runs, tods_get_deadheads, or tods_inspect_feed. No prerequisites, no exclusions, no mention of which filter combinations are meaningful. The usage context must be inferred from the name alone.

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

tods_inspect_feedA

Inspects a TODS (Transit Operational Data Standard) directory or .zip feed. Returns high-level statistics, table list, supplement counts, crew runs, and fleet totals.

ParametersJSON Schema
NameRequiredDescriptionDefault
feed_pathYesPath to local directory or .zip containing the TODS / GTFS dataset.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the read-only inspection scope and what the summary contains, but says nothing about behavior on invalid/non-TODS feeds, whether it fails or partial-results, performance on large zips, or permissions.

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?

Two sentences, zero filler, with the core action front-loaded and the return contents listed compactly afterward.

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?

No output schema exists, so the description usefully enumerates what comes back, which is exactly what an agent needs for this single-parameter read tool. Only minor gaps remain around error behavior and large-feed handling.

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% for the single feed_path parameter, already documenting that it accepts a local directory or .zip. The description adds no format or edge-case detail beyond that, so the baseline 3 applies.

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?

Names a specific verb and resource ('Inspects a TODS directory or .zip feed') and enumerates the outputs (statistics, table list, supplement counts, crew runs, fleet totals). It is clearly distinguishable from granular getters like tods_get_runs, though it never names validate_feed as the alternative, so sibling differentiation is only implicit.

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 output list implies this is the overview/first-look tool before drilling into runs or vehicle assignments, but the description never states when to use it instead of tods_validate_feed or the specific getters, and gives no prerequisites or exclusions.

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

tods_merge_supplementsC

Applies the official TODS v2.1.0 supplement merge algorithm (_supplement.txt files onto base GTFS files). Returns merge summary, additions, deletions, updates, and diffs.

ParametersJSON Schema
NameRequiredDescriptionDefault
feed_pathYesPath to local directory or .zip containing the TODS dataset.
table_nameNoOptional: Specific table to view diffs for (e.g. "trips.txt", "stops.txt", "calendar.txt"). If omitted, all files are merged.
sample_limitNoMaximum number of sample diffs or merged rows to return. Default 20.

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the return contents (summary, additions, deletions, updates, diffs) but never says whether the merge mutates the base files in place, writes to a new output location, overwrites existing data, or is idempotent - critical for a mutation-style operation.

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 tight sentences with the operation and its return payload front-loaded and no filler. The only mild weakness is the vague term 'diffs' left undefined.

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

Completeness3/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 does list what is returned, which is helpful, and the 100%-covered params need no further explanation. However, for a merge/write tool with zero annotations, the missing disclosure about file mutation and side effects leaves it only partially complete.

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%, so feed_path, table_name (with format examples), and sample_limit (with default) are already fully documented in the schema. The description adds no syntax or format detail beyond that, which is the expected baseline when the schema does the heavy lifting.

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?

States a specific verb (applies the official TODS v2.1.0 supplement merge algorithm) and resource (_supplement.txt files onto base GTFS files), which is clearly distinct from the read-only siblings like tods_inspect_feed and tods_validate_feed. It does not explicitly name or route against a sibling, but the merge operation is unambiguous.

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

Usage Guidelines2/5

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

No when-to-use guidance, no prerequisites (e.g. that the feed must contain _supplement.txt files), and no named alternatives among the sibling tools. The agent must infer that this is the write/merge step versus the inspect/validate steps.

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

tods_validate_feedB

Runs comprehensive TODS v2.1.0 validation against the dataset: primary key uniqueness, foreign key consistency (run_events -> supplemented calendar/trips/stops), non-overlapping trip runs, time format/chronology, and TODS_delete rules.

ParametersJSON Schema
NameRequiredDescriptionDefault
feed_pathYesPath to local directory or .zip containing the TODS dataset.

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It usefully enumerates the validation dimensions, which is real behavioral information, but it does not say whether the tool is read-only, whether it raises errors or returns a report, whether it is expensive/long-running, or what happens on failure. The check list is helpful but the operational behavior remains underspecified.

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?

It is a single dense sentence that is front-loaded with the action and then lists the checks, with essentially no filler. Slightly long as one sentence but every clause names a distinct validation concern, so it earns its length.

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

Completeness3/5

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

With no output schema and no annotations, the description must be self-sufficient, but it never explains the return value or failure mode, which for a validator is the key information. The check enumeration partially compensates, but the agent still cannot predict what it gets back or how to act on results.

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% for the single feed_path parameter, so the schema already documents the one input, including acceptable directory and .zip forms. The description adds nothing about the parameter, so the baseline of 3 for a well-covered schema applies.

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 (validates) and resource (TODS dataset), then enumerates the concrete checks performed (primary key uniqueness, foreign key consistency, non-overlapping runs, time format, TODS_delete rules). It clearly conveys what the tool does, though it never contrasts itself with the sibling tods_inspect_feed, leaving the agent to infer the boundary between validation and inspection.

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

Usage Guidelines2/5

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

There is no statement of when to run validation versus the sibling tools (tods_inspect_feed, tods_merge_supplements), nor any prerequisite or when-not guidance. Usage is only weakly implied by the name and check list, so an agent must guess the workflow position of this tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv1.0.0
    • First observedtods_get_deadheads
    • First observedtods_get_runs
    • First observedtods_get_vehicle_assignments
    • First observedtods_inspect_feed
    • First observedtods_merge_supplements
    • First observedtods_validate_feed

TDQS

A3.6/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct operation: inspection, merging, validation, and entity-specific queries for runs, vehicle assignments, and deadheads. There is no meaningful overlap because inspect/validate/merge have clearly different outputs and each get_ tool is scoped to a different TODS entity.

Naming Consistency5/5

All tools consistently use the tods_ prefix followed by a verb_noun pattern: inspect_feed, merge_supplements, validate_feed, get_runs, get_vehicle_assignments, get_deadheads. No mixed casing, inconsistent verbs, or irregular naming conventions are present.

Tool Count5/5

Six tools is a well-scoped count for a TODS-specific server. The set covers feed-level operations and targeted queries without redundancy or unnecessary bloat.

Completeness4/5

The surface covers the main TODS workflows: inspect, merge supplements, validate, and query core operational entities. Minor conveniences like a dedicated vehicle-only query or raw table access are missing, but these are workaroundable and do not create dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP-ORTools integrates Google's OR-Tools constraint programming solver with Large Language Models through the MCP, enabling AI models to: Submit and validate constraint models Set model parameters Solve constraint satisfaction and optimization problems Retrieve and analyze solution
    21
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients to serve and query semantic models, providing tools for entity descriptions, metric lookups, context resolution, and operation validation for AI agents.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients to invoke every typeship API operation as a tool, with spec-derived input schemas, argument validation, read-only mode, and selective tool exposure.
    26 npm
    MIT