Skip to main content
Glama

Train ticket price

mb_train_price
Read-onlyIdempotent

Calculate exact train class prices for a group, including adult, child, infant, foreigner and empty-berth fares plus the total. Check seat availability before relying on a sold-out class price.

Instructions

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

A sold-out class still returns a price: check seats_left in the search first. The breakdown does not add up exactly to the price; the price is what is paid.

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": {
      "class_id": "<class_id>"
    },
    "name": "mb_train_price"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • changedInput schema / properties / class_id / description
      Previous value: -"class_id of a train class from a fresh mb_search_trains result, e.g. 9847134."New value: +"class_id from a fresh mb_search_trains result."
    • changedInput schema / properties / empty_seats / description
      Previous value: -"Empty berths to buy for a whole (exclusive) compartment, e.g. 1 for 3 people in a 4-berth."New value: +"Empty berths to buy for a whole compartment, e.g. 1 for 3 people in a 4-berth."
    • removedInput schema / title
      Removed value: -"mb_train_priceArguments"
  2. 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
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, so the bar is lower, and the description adds two genuinely non-obvious traits: sold-out classes still return a price, and the per-category breakdown does not sum exactly to the amount charged. That second caveat is exactly the kind of gotcha that prevents an agent from mis-reporting totals. It omits currency and whether fees or taxes are folded into the figure.

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?

Three short sentences, front-loaded with the price-and-breakdown claim, then the sold-out precondition, then the caveat about the breakdown. Nothing is padded, though the phrase "the breakdown does not add up exactly to the price" is slightly opaque about which side of the transaction it refers to.

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 read-only price lookup with six fully documented parameters and no output schema, the description covers the inputs as a party composition, the return shape as a per-category breakdown plus total, and the key caveats. Adding currency and whether taxes or fees are included would close the remaining gap.

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, including age bands, maximums, and the empty-berth example. The description only restates the same categories in prose, adding no syntax, defaults, or interaction rules beyond what the schema provides, so the baseline of 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?

The description names a specific verb-and-resource pair: the exact price of one train class for a party, with a breakdown by passenger category. An agent can tell it apart from mb_train_price_calendar and mb_search_trains, though those siblings are never named explicitly, so the differentiation is inferred rather than stated.

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?

"Check seats_left in the search first" gives a clear ordering rule that points to mb_search_trains as the required prior step and explains why the tool is still usable for sold-out classes. It does not cover when to prefer the calendar variant over this one, so it falls short of full when/when-not guidance.

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