Skip to main content
Glama

Train ticket price

mb_train_price
Read-onlyIdempotent

Calculate exact train fare for one class and a passenger party, covering adult, child, infant, foreigner, empty-berth pricing, and the total.

Instructions

Exact price of one train class for a party: per adult, child, infant, foreigner and empty berth, and the total.

class_id comes from mb_search_trains (it expires with the search). A sold-out class still returns a price here, so check seats_left in the search first. breakdown is the adult fare's parts (they do not add up exactly to the price; the price is what is paid).

Input Schema

NameRequiredDescriptionDefault
adultsNoAdults (12+).
infantsNoInfants (under 2).
childrenNoChildren (2-11).
class_idYesclass_id of a train class from a fresh mb_search_trains result, e.g. 9847134.
foreignersNoForeign passengers (priced separately).
empty_seatsNoEmpty berths to buy for a whole (exclusive) compartment, e.g. 1 for 3 people in a 4-berth.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.3.0
    • removedInput schema / properties / adults / title
      Removed value: -"Adults"
    • removedInput schema / properties / children / title
      Removed value: -"Children"
    • removedInput schema / properties / class_id / title
      Removed value: -"Class Id"
    • removedInput schema / properties / empty_seats / title
      Removed value: -"Empty Seats"
    • removedInput schema / properties / foreigners / title
      Removed value: -"Foreigners"
    • removedInput schema / properties / infants / title
      Removed value: -"Infants"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "mb_train_priceDictOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), yet the description adds non-obvious session semantics (class_id expiry), a misleading-success case (sold-out classes still priced), and a data quirk (breakdown parts do not sum to the charged price). These are exactly the behaviours an agent cannot infer from structured 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?

Three short sentences: what it returns first, then the prerequisite, then the sold-out caveat, with the breakdown note last. No filler, no restatement of the title or schema.

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 no output schema, the description carries return-value disclosure and does so reasonably ('per adult, child, infant, foreigner and empty berth, and the total'), plus it warns about the breakdown's non-additivity. It omits error behaviour (e.g. expired class_id) and currency, minor gaps for a read-only price lookup.

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%, so the baseline is 3, and the description meaningfully exceeds it by explaining that the party composition (adult/child/infant/foreigner/empty berth) drives the returned breakdown. It adds interpretive value but no syntax or unit detail (e.g. currency) 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?

Names a specific verb+resource ('Exact price of one train class for a party') and enumerates the pricing dimensions returned, so an agent knows precisely what it computes. It also points at the source of class_id (mb_search_trains), which separates it from the search tool, though it never contrasts itself with the sibling mb_train_price_calendar or mb_flight_fare_details.

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 real precondition and a trap to avoid: class_id comes from mb_search_trains and expires with the search, and a sold-out class still returns a price so seats_left should be checked first. It does not state when to prefer the calendar variant or any explicit when-not case, so it stops short of a full 5.

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