Skip to main content
Glama

Train tickets

al_trains
Read-onlyIdempotent

Search train tickets between two Iranian cities on a chosen date and get company, class, departure and arrival times, price per adult, seats left, and round-trip return options.

Instructions

Search train tickets between two Iranian cities on one day: company, class, times, price and seats left.

Prices are Toman per adult. seats_left 0 means sold out. Pass return_date for the way back. For a flexible date call al_trains_cheapest first. After midnight the rail suppliers may be down; retry later.

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": {
      "origin": "<origin>",
      "destination": "<destination>",
      "date": "<date>"
    },
    "name": "al_trains"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesGregorian 2026-11-11 or Jalali 1405-08-20.
sortNoSort order.departure
limitNoMax results.
originYesCity name (تهران, Mashhad) or code (THR); see al_cities.
passengersNoTravellers; seats_left is for this group size.
destinationYesCity name (تهران, Mashhad) or code (THR); see al_cities.
return_dateNoRound-trip return day; adds `returning`.
ticket_typeNofamily = mixed compartments; female/male = single-gender (seat counts differ).family
wagon_classNoKeep only this class_code: EC (4-berth), EL (6-berth), S (saloon), V.
only_availableNoHide sold-out trains.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.2.0
    • changedInput schema / properties / date / description
      Previous value: -"Travel date, Gregorian 2026-11-11 or Jalali 1405-08-20 (the year tells which)."New value: +"Gregorian 2026-11-11 or Jalali 1405-08-20."
    • changedInput schema / properties / destination / description
      Previous value: -"City name in Persian or English (تهران, Mashhad) or its code (THR, MHD); al_cities lists them."New value: +"City name (تهران, Mashhad) or code (THR); see al_cities."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results."New value: +"Max results."
    • changedInput schema / properties / origin / description
      Previous value: -"City name in Persian or English (تهران, Mashhad) or its code (THR, MHD); al_cities lists them."New value: +"City name (تهران, Mashhad) or code (THR); see al_cities."
    • changedInput schema / properties / passengers / description
      Previous value: -"Number of travellers; seats_left is for this group size."New value: +"Travellers; seats_left is for this group size."
    • changedInput schema / properties / return_date / description
      Previous value: -"Return day for a round trip (same formats as `date`); adds a `returning` list."New value: +"Round-trip return day; adds `returning`."
    • changedInput schema / properties / sort / description
      Previous value: -"Order of the results."New value: +"Sort order."
    • changedInput schema / properties / ticket_type / description
      Previous value: -"family = mixed compartments; female or male = single-gender compartments (seat counts differ)."New value: +"family = mixed compartments; female/male = single-gender (seat counts differ)."
    • changedInput schema / properties / wagon_class / description
      Previous value: -"Keep only this class code from the results, e.g. EC (compartment), EL (6-berth), S (saloon), V."New value: +"Keep only this class_code: EC (4-berth), EL (6-berth), S (saloon), V."
  2. First observedv0.1.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare a safe, read-only, idempotent, open-world read, and the description adds genuinely new behavior: prices are in Toman per adult, seats_left of 0 means sold out, and rail suppliers may be unavailable after midnight. It stops short of describing pagination or result-shape details beyond naming key fields.

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?

Four tightly written sentences lead with the core action and the returned fields, then layer in pricing units, routing advice, and the operational caveat. Nothing is redundant or padded.

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?

With 10 parameters, no output schema, and a multi-mode search tool, the description covers output fields, unit conventions, sold-out semantics, and a failure mode. What remains thin is whether results are paginated or capped beyond the limit parameter, but the safety and intent picture is 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 parameters are already documented; the description only reinforces return_date as the round-trip input and notes it adds a `returning` field. That is a small increment over the schema's own `returning` note and per-group seats_left wording.

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?

The description gives a specific verb and resource ("Search train tickets between two Iranian cities on one day") and enumerates what comes back (company, class, times, price, seats left). It is immediately distinguishable from siblings such as al_buses, al_flights, and al_trains_cheapest.

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?

It explicitly routes flexible-date searches to al_trains_cheapest and warns to retry after midnight when rail suppliers are down, which is actionable when-to-use guidance. It does not cover when to prefer other transport siblings or how to resolve city names beyond the schema's pointer to al_cities.

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