Skip to main content
Glama

Plan journey

plan_journey
Read-only

Plan journeys between two station IDs with departure/arrival times, transport filters, transfer limits, bike and step-free options. Use returned references to get later or earlier connections.

Instructions

Plan journeys between two stops/stations given as ids (use find_stations first). Returns up to results journeys, each a list of legs (walking or a vehicle) with times, line, platform and a tripId for get_trip (legs list no intermediate stops). For later or earlier journeys, call again with the same arguments, but with departure/arrival replaced by laterThan/earlierThan set to the returned laterRef/earlierRef. No ticket or price data. Times are ISO 8601 in each station's local time with its UTC offset; stops carry their IANA tz (none = German time). Delays in seconds (positive = late). Planned values equal to realtime ones and empty fields are omitted. Results: JSON, then "Hints:" (situational advice; attribution, credit once).

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "plan_journey"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesDestination: Stop/station id from find_stations - not a name.
viaNoStop(s) the journey must pass through, in order: one id or a list of 2. Stop/station id from find_stations - not a name. For more, plan each section.
bikeNoOnly journeys on which every vehicle is confirmed to carry bikes; legs then show `bikesAllowed: true` (default false). Vehicles without bike data are left out (coverage is patchy, e.g. many regional and long-distance trains), so a missing connection does not mean bikes are not allowed.
fromYesOrigin: Stop/station id from find_stations - not a name.
arrivalNoArrive at or before this time, ISO 8601 with UTC offset, local to the destination. Use the UTC offset valid at the station's location on that date (Germany: +01:00 in winter, +02:00 in summer).
resultsNoMaximum number of journeys (1-10, default 5).
productsNoOnly journeys using these kinds of transport (default: all). Ids: `nationalExpress` (high-speed trains: ICE, TGV, Eurostar), `national` (other long-distance trains: IC/EC, FlixTrain, night trains), `regional` (regional trains: RE, RB, IRE), `suburban` (S-Bahn, RER), `subway` (U-Bahn, metro), `tram`, `bus` (local buses), `coach` (long-distance buses, e.g. FlixBus), `ferry`, `taxi` (on-demand services). For the Deutschlandticket (or other local/regional-transport tickets) pass ["regional", "suburban", "subway", "tram", "bus", "ferry"] (an approximation). Rail replacement buses are `bus` (often under the train's line name): a filter without `bus` drops them.
departureNoDepart at or after this time, ISO 8601 with UTC offset (e.g. 2026-11-14T08:00+01:00), local to the origin; default now. Use the UTC offset valid at the station's location on that date (Germany: +01:00 in winter, +02:00 in summer).
laterThanNo`laterRef` of a previous result: the next later journeys.
wheelchairNoStep-free routing of the walking parts (transfers, first/last mile; default false). Vehicles are not filtered: legs show `wheelchairAccessible: true` where the data confirms it.
earlierThanNo`earlierRef` of a previous result: earlier journeys.
maxTransfersNoMaximum number of changes between vehicles (0 = direct only; default unlimited).
viaMinimumStayNoMinimum stay at `via` in minutes, one value per via stop or one for all (requires `via`; default 0 = passing through is enough).
minTransferTimeNoMinimum minutes per change, e.g. 10 for luggage or reduced mobility (default: the station's own transfer time).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld; the description adds substantive behavior: legs list no intermediate stops, at most `results` journeys, no fare data, ISO 8601 local times with UTC offsets, IANA `tz` per stop with a German-time default, delays in seconds with sign convention, omission of equal/empty fields, and that output is JSON followed by a 'Hints:' block requiring one-time attribution.

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 the core action and prerequisites, then pagination, then output semantics — a sensible ordering. It is a dense block rather than bullets, and the timezone/`tz` sentence plus the Hints attribution note make it long, but nearly every clause carries operational information.

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?

For a 14-parameter, open-world routing tool with no output schema, the description supplies the missing return contract (journey/leg structure, refs for paging, Hints block) and the relevant limitations (no prices, delay semantics, omitted fields). Nothing an agent needs in order to call and continue correctly is absent.

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% and the schema itself is unusually rich (bike coverage caveats, product ids, Deutschlandticket approximation), so the baseline is already high. The description still adds value the schema cannot: `laterThan`/`earlierThan` must be populated from the `laterRef`/`earlierRef` fields of a previous response, and `results` caps the returned journey count.

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 (plan journeys between two stops given as ids) and immediately scopes it against siblings: ids come from find_stations, and each leg's `tripId` feeds get_trip. An agent can distinguish this from get_trip/get_departures without opening any schema.

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?

Explicit precondition (use find_stations first), explicit follow-up routing (pass `tripId` to get_trip), and a concrete procedure for pagination: call again with identical arguments but swap `departure`/`arrival` for `laterThan`/`earlierThan` using the returned `laterRef`/`earlierRef`. It also bounds expectations with 'No ticket or price data.'

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