Skip to main content
Glama

Train tickets

al_trains
Read-onlyIdempotent

Search train tickets between two Iranian cities on a travel date and optional return day, returning company, wagon class, departure and arrival times, price in Toman, and seats left; filter sold-out trains.

Instructions

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

Use for "trains from Tehran to Mashhad on 1405-08-20". Prices are Toman per adult. seats_left 0 means sold out. class is the wagon name (stars, berths, meals) and class_code its type: S saloon seats, EC 4-berth compartment, EL 6-berth compartment, V special. Pass return_date for the way back. Call al_trains_cheapest to compare prices over the following days. While the rail suppliers are in their maintenance window (usually after midnight) the site answers with an error; try again in a few minutes.

Input Schema

NameRequiredDescriptionDefault
dateYesTravel date, Gregorian 2026-11-11 or Jalali 1405-08-20 (the year tells which).
sortNoOrder of the results.departure
limitNoMaximum number of results.
originYesCity name in Persian or English (تهران, Mashhad) or its code (THR, MHD); al_cities lists them.
passengersNoNumber of travellers; seats_left is for this group size.
destinationYesCity name in Persian or English (تهران, Mashhad) or its code (THR, MHD); al_cities lists them.
return_dateNoReturn day for a round trip (same formats as `date`); adds a `returning` list.
ticket_typeNofamily = mixed compartments; female or male = single-gender compartments (seat counts differ).family
wagon_classNoKeep only this class code from the results, e.g. EC (compartment), EL (6-berth), S (saloon), V.
only_availableNoHide sold-out trains.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare read-only and idempotent, and the description adds substantive behavior on top: prices are in Toman per adult, seats_left 0 means sold out, return_date adds a separate `returning` list, and suppliers error out during a post-midnight maintenance window so a retry in a few minutes is expected. That error-window warning is exactly the operational context annotations cannot carry.

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-loads the purpose, then the trigger example, then behavioral caveats; almost every sentence carries new information. Slightly dense with parenthetical code lists, but nothing is padding.

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?

For a 10-parameter, output-schema-less tool, the description sufficiently covers return fields, currency units, sold-out semantics, and a known failure mode. It leaves sort/limit/passengers behavior to the schema, which handles them adequately.

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 the schema already documents every parameter including date formats, city codes, and enum values. The description adds only marginal semantics beyond that – the meaning of a zero seats_left and the `returning` output list – plus a restatement of the class codes. Baseline 3 fits.

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 ('Search train tickets between two Iranian cities on one day') and enumerates what comes back: company, class, times, price, seats left. The sibling al_trains_cheapest is named as a distinct tool, so an agent can route without opening either schema.

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?

Gives a concrete trigger example ('trains from Tehran to Mashhad on 1405-08-20') and an explicit alternative with its condition ('Call al_trains_cheapest to compare prices over the following days'). It does not address the non-rail siblings (al_buses, al_flights) or say when a rail search is the wrong choice, leaving some routing to inference.

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