japan-rail-mcp
japan-rail-mcp
japan-rail-mcp — это сервер Model Context Protocol в режиме только чтения для структурированных данных о японских железных дорогах. Версия 0.1 намеренно ориентирована в первую очередь на Синкансэн (Shinkansen-first): она предоставляет полезный каталог станций, не требующий учетных данных, и может запрашивать актуальные расписания Синкансэн, тарифы, классы мест и рейсы через ключ владельца развертывания к тарифному плану Ekispert API Standard.
Сервер никогда не бронирует билеты, не входит в учетные записи железнодорожных систем, не обходит ограничения доступа, не собирает данные с сайтов операторов и не выдает тестовые фикстуры за реальные данные.
japan-rail-mcp спроектирован так, чтобы иметь общий концептуальный интерфейс с china-rail-mcp, с долгосрочной целью создания интероперабельных схем для железнодорожных MCP-серверов в разных странах.
Это экспериментальное соглашение по интероперабельности, а не официальный железнодорожный стандарт или стандарт MCP.
Возможности
Возможность | Без ключа API | С |
Поиск станций по японским, английским и романизированным названиям | Да, встроенный каталог из 58 станций, ориентированный на Синкансэн | Да |
Варианты-кандидаты при неоднозначных станциях | Да. | Да |
Поиск прямых перевозок в расписании Синкансэн | Явно не поддерживается | Да, в зависимости от тарифного плана ключа |
Суммы тарифов в числовом виде (JPY) | Явно не поддерживается | Дае |
Нормализация классов мест | Явно не поддерживается | Да |
Упорядоченные остановки поезда | Явно не поддерживается | Дае |
Наличие мест для бронирования / доступность | Явно не поддерживается | Явно не поддерживается |
Поиск маршрутов с пересадками | Явно не поддерживается в v0.1 | Явно не поддерживается в v0.1 |
Все успешные данные содержат указание на источник. Железнодорожные временные метки — это явные значения ISO 8601 со смещением японского часа, например 2026-08-26T12:03:00+09:00. Относительные даты, такие как «завтра», должны разрешаться клиентом MCP; сервер требует YYYY-MM-DD.
Related MCP server: japan-transit-mcp
Инструменты MCP
Инструмент | Когда использовать |
| Проверьте настроенных провайдеров и границы возможностей перед «живым» запросом. |
| Приведите имя к одному или нескольким каноническим ID |
| Поиск прямых рейсов Синкансэн между двумя разрешенными ID станций. |
| Читает упорядоченные остановки для непрозрачного |
| Проверяет поддержку провайдером; сейчас возвращает |
| Сортирует уже структурированные кандидаты прямых поездов без субъективной рекомендации. |
| Зарезервирован для пересадочных маршрутов; в v0.1 возвращает структурированную ошибку о неподдержке. |
Каждый инструмент аннотирован как read-only (только чтение), не разрушающий и идемпотентный. Каждый успешный результат инструмента включает как читаемый JSON-текст, так и MCP structuredContent, проверенный по выходной схеме.
Установка
Требования: Node.js 22 или новее. В CI используется Node.js 24 LTS.
git clone https://github.com/TakeruF/japan-rail-mcp.git
cd japan-rail-mcp
npm install
npm run buildЗапустите stdio-сервер:
npm startПосле npm-релиза клиенты могут запускать его и таким способом:
npx -y japan-rail-mcpАктуальные данные Синкансэн
Функциональность «живого» расписания требует ключа доступа, в рамках которого соглашение об использовании Ekispert API включает точку (endpoint) поиска маршрутов плана Standard. Бесплатный план не предоставляет этой основной конечной точки.
export EKISPERT_API_KEY='your-own-key'
npm startКлюч отправляется только на настроенную конечную точку Ekispert API. Он никогда не возвращается в результатах инструментов и не включается в ошибки провайдера. Проект не содержит общего ключа, не предоставляет сублицензии на данные провайдера и не отменяет лимиты запросов, предусмотренные вашим соглашением.
Конфигурация клиента
Claude Desktop
Для локальной копии добавьте запись такого вида и замените абсолютный путь:
{
"mcpServers": {
"japan-rail": {
"command": "node",
"args": ["/absolute/path/to/japan-rail-mcp/dist/index.js"],
"env": {
"EKISPERT_API_KEY": "your-own-key"
}
}
}
}Если нужен только поиск станций, опустите объект env. Предпочитайте использовать механизм управления секретами вашего клиента, а не хранить ключи в репозитории конфигурации.
Codex
Зарегистрируйте собранную stdio-команду в конфигурации MCP у Codex или используйте CLI-форму, поддерживаемую вашей установленной версией Codex:
codex mcp add japan-rail -- node /absolute/path/to/japan-rail-mcp/dist/index.jsПередавайте EKISPERT_API_KEY через переменные окружения процесса или через секретный конфигуратор Codex, когда требуются данные о поездах в реальном времени.
Примеры использования инструментов
Сначала найдите кандидатов-станций:
{
"query": "Osaka"
}Результат намеренно включает и станцию Осака, и станцию Син-Осака, когда это именно. Затем используйте точные ID:
{
"fromStationId": "jp:station:tokyo",
"toStationId": "jp:station:shin-osaka",
"date": "2026-08-26",
"departureAfter": "12:00",
"serviceTypes": ["shinkansen"],
"limit": 10,
"offset": 0
}Нормализованный тариф — число, безопасное при работе с валютами:
{
"amount": 14720,
"currency": "JPY",
"formatted": "¥14,720",
"kind": "total"
}formatted предназначен только для отображения; для сравнения клиентам следует использовать amount и currency.
Источники данных
Встроенный каталог станций
Поддерживаемый проектом каталог охватывает 58 значимых-станций: действующие сети Синкансэн и небольшой набор станций, специально сделанных неоднозначными для сравнения, например станции Осака, Синдзюку и Фукуока в префектуре Тояма. В нем содержатся метаданные станций — без расписаний, тарифов или данных о наличии. Карты маршрутов операторов и страницы проезда указаны в Оцените источники.
API Ekispert
Опциональный провайдер использует документированные конечные точки API и ключ доступа владельца развертывания. Он запрашивает явную дату, явную полночь, если нижняя временная граница не задана, а также остановки, типы мест и сведения об операторе. В ответах указываются ekispert-standard, назваление конечной точки, время получения, статус в реальном времени и граница соглашения с провайдером.
Источники, не используемые для данных расписания Синкансэн
Текущий ODPT JR East набор данных расписаний поездов прямо исключает Синкасэн.
GTFS-JP v4 — это спецификация данных, а не общенациональный фид и не универсальная лицензия на данные.
Публичные страницы JT и PDF-файлы с расписаниями не предоставляют проекту универсального API и лицензию на перераспределение, поэтому они не парсятся и не объединяются для бандла.
См. docs/data-sources.md — там уточненный анализ источников и основные ссылки.
Архитектура
MCP tools
-> RailService
-> StationCatalogProvider
-> StaticShinkansenStationProvider
-> RailDataProvider
-> EkispertProvider (optional key)
core rail schemas
+ Japan extensions
+ provider-private parsing and identifiersMCP-обработчики проверяют и описывают вызовы инструментов, но не загружают и не разбирают данные провайдера. Проверки возможностей закрываются (fail closed) до обращения к сети. search_trains представляет собой физическую поездку прямого поезда; search_journeys — маршрут, в который могут входить пересадки. Границы извлечения см. в docs/architecture.md.
Связь с china-rail-mcp
Общие имена инструментов:
search_stationssearch_trainsget_train_detailsget_availabilitycompare_trains
Общие контактные схемы: Station, StationRef, Train, Journey, Fare, SeatClass, SeatAvailability, Source, RailError и RailProviderCapabilities. Контракт сохраняет числовые тарифы ISO 4217, явные сдвиги времени с поправкой на страну, схождение данных, канонические ID станций, важные для возможностей провайдера проверки и структурированные ошибки.
Данные, специфичные для Японии, находятся в extensions.japan, например:
линии и названия сервисов Синсивозовиц;
названия станции в терминологии провайдера;
пассажирские номера поездов и операционные/провайдерские идентификаторы;
японские обозначения мест такие как
自由席,指定席,グリーン車иグランクラス.
Эти границы — кандидаты на будущую независимую спецификацию rail-mcp-spec; данный репозиторий не утверждает, что такой стандарт уже существует.
Ограничения
Установка без потребностей и доверия ключей ищет только станции.
Поведение «живых» поездов имеет контрактные тесты на тест-фикстурах, но не испытано на реальном аккаунте в этом репозитории. Успешноя работа фикстуры — это не доказательство реального доступа к провайдеру.
Тарифный план Ekispert Standard, лимиты, сервис, коммерческое использование, кэширование и права на расписку зависят от соглашения владельца развертывания.
Результаты подлинного поиск ограничиваются первыми 20 ответами провайдера за запрос.
search_trainsвозвращает только прямые маршруты Синкенсэн. Пересадки не участие молча строятся в прямые.Seat-классы и опубликованные тарифы — это не наличие мест.
get_availabilityпо-прежнему не поддерживается.Перебои в движении и текущие позиции поездов не втянуты.
Встроенный каталог станций сосредоточен на Синкансэн, он не является полным национальным клубом данных.
Важные условия поездок, тарифов и билетов следует уточнять у оператора железных дорог или в авторизованном канале бронирования.
Разработка
npm install
npm run lint
npm run typecheck
npm test
npm run build
npm run formatТесты охватывают сопоставление станций на японском/английском, неоднозначность, парсинг фикстур Токио–Син-Осака, явные даты и границы токиского времени, сбое провайдера, неподдерживаемую викторию, структурированный вывод MCP, read-only аннотации и общий многократно используемый контракт схемы рельсовых данных.
Безопасность и только чтение
Инструментов покупки билетов, бронирования, входа, оплаты, ввода CAPTCHA, профиля или изменения данных нет. См. SECURITY.md — там рекомендации по обращению с ключами и данными.
Лицензия
Исходный код проекта доступен по лицензии MIT. Эта лицензия относится только к коду собственного репозитория; она не перелицензирует и не объединяет данные от железнодорожных операторов, ответы сервиса Ekispert, наборы данных ODPT, материалы GTFS-фидов или товарные знаки третьих сторон. Каждый источник данных остается под собственными условиями использования.
Available Tools
7 toolscompare_trainsCompare direct Shinkansen trainsBRead-onlyIdempotent
Use to sort structured direct-train candidates by departure, arrival, duration, or total fare. This tool does not make a subjective recommendation.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| limit | No | ||
| offset | No | ||
| sortBy | No | departure_time | |
| operators | No | ||
| toStationId | Yes | Canonical ID returned by search_stations. | |
| serviceTypes | No | ||
| fromStationId | Yes | Canonical ID returned by search_stations. | |
| departureAfter | No | ||
| departureBefore | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| limit | Yes | |
| total | Yes | |
| offset | Yes | |
| trains | Yes | |
| hasMore | Yes | |
| returned | Yes | |
| nextOffset | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds the behavioral note that it does not provide a subjective recommendation, which is useful context not present in annotations. However, it doesn't describe what happens to the input (e.g., whether it returns a new sorted list or modifies in place), though given readOnly and idempotent hints, this is largely implied. The description adds value but not deeply.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no wasted words. The intent is front-loaded, and the clarifying statement about not making subjective recommendations is succinct and adds value without bloat. This is an appropriately concise description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 10 parameters (3 required) and schema coverage is only 20%, the description is far from complete. It doesn't explain what input structure is expected (though it says 'structured direct-train candidates'), how the tool integrates with siblings like search_trains, or the meaning of most parameters. While an output schema exists, the input semantics and usage context are inadequately described for an agent to call it correctly without additional information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 20%, meaning the description must compensate for the many undocumented parameters. The description explains the sort criteria (departure, arrival, duration, total fare) which maps to the sortBy enum, but it fails to explain other critical parameters like fromStationId, toStationId, date, limit, offset, operators, serviceTypes, and time filters. With 10 parameters and such low coverage, the description does not help an agent understand how to construct a valid request beyond the sort field.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action: sorting structured direct-train candidates by departure, arrival, duration, or total fare. It distinguishes itself from recommendation tools by explicitly noting it does not make a subjective recommendation. However, it doesn't clarify whether the tool expects a pre-fetched list or fetches its own candidates, leaving some ambiguity about its exact role relative to search tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies that the tool should be used when you have structured direct-train candidates and want to sort them, but it does not explicitly state when to use it versus alternatives like search_trains or search_journeys. It would benefit from a note like 'After search_trains returns candidates, use this to sort them' or an explicit exclusion of other tools. The note about not making a subjective recommendation gives a hint of what it does not do, but not when to choose it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_availabilityGet seat availabilityARead-onlyIdempotent
Use only to check whether the configured provider exposes seat inventory for an exact train and station pair. The default provider returns an explicit unsupported status and never fabricates inventory.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| trainId | Yes | ||
| toStationId | Yes | Canonical ID returned by search_stations. | |
| fromStationId | Yes | Canonical ID returned by search_stations. |
Output Schema
| Name | Required | Description |
|---|---|---|
| seats | No | |
| reason | No | |
| source | No | |
| status | Yes | |
| retrievedAt | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the agent knows it's a safe, non-mutating read. The description adds value by disclosing that the provider returns an explicit unsupported status and never fabricates inventory, which is a critical behavioral detail not covered by annotations. This provides meaningful context beyond the 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The key scope ('Use only to check...') is front-loaded, followed by a single behavioral note. Every word earns its place, and the structure is immediately scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only check with an output schema (present but not shown), the description covers the core purpose, the main behavioral nuance (unsupported status), and safety via annotations. It does not describe error conditions or validate input requirements, but given the output schema exists and the tool's simplicity, what is provided is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50%: fromStationId and toStationId have descriptions ('Canonical ID returned by search_stations.'), while trainId and date have none. The description mentions 'exact train and station pair' but does not elaborate on how to obtain trainId or the date format, nor does it reference train identifiers from any sibling tool. Since coverage is low (<80%), the description should compensate but does not, leaving two parameters poorly documented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Use only to check whether the configured provider exposes seat inventory for an exact train and station pair', which names the verb (check), the resource (seat inventory), and the precise scope (exact train and station pair). This clearly separates it from sibling tools like get_train_details or search_journeys without ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Use only' explicitly restricts the tool to this specific check, and the description states that the default provider may return an unsupported status. However, it does not name alternative tools for broader journey planning or explicitly state when NOT to use it, though the restriction is implicit. This is clear context but lacks named alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_provider_statusGet rail provider statusARead-onlyIdempotent
Use before live train queries to see which read-only capabilities are configured and why unavailable capabilities are disabled.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| notes | Yes | |
| provider | Yes | |
| configured | Yes | |
| capabilities | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds value by explaining that it shows configuration state and the reasons for unavailable capabilities, which is beyond what annotations provide. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that places the usage guidance first and includes no filler. Every phrase contributes essential context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values are already structured. The description covers the tool's purpose, when to use it, and what it reveals, which is complete for a zero-parameter tool with annotations covering safety aspects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the description carries no burden to explain parameter meaning. Per the baseline for 0-parameter tools, a score of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'see' and resource 'rail provider status', and explicitly describes what the tool reveals: which read-only capabilities are configured and why disabled capabilities are unavailable. This clearly differentiates it from sibling tools that handle live train queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives an explicit usage condition: 'Use before live train queries.' This tells the agent when to invoke it. However, it does not name alternative tools or explicitly state when not to use it, so it falls 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.
get_train_detailsGet Shinkansen train detailsARead-onlyIdempotent
Use with the opaque trainId returned by search_trains to retrieve that service and its ordered stops. Do not construct train IDs manually.
| Name | Required | Description | Default |
|---|---|---|---|
| trainId | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| stops | Yes | |
| train | Yes | |
| source | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive behavior, covering the safety profile. The description adds the 'ordered stops' detail, which hints at the response structure, but doesn't disclose additional side effects or edge cases. This is adequate given the strong annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each earning its place. The primary usage instruction is front-loaded, and the warning about manual construction is a concise, valuable addition. No fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with an output schema available, the description covers the essential usage (source of ID, what to retrieve). An agent has everything needed to call it correctly without external context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% and the schema only has minLength. The description compensates by stating the trainId is opaque and must come from search_trains, not constructed manually. This adds crucial semantic meaning that the raw schema lacks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('retrieve') and the specific resource ('that service and its ordered stops'), and explicitly ties it to the opaque trainId from search_trains. This distinguishes it from sibling tools like search_trains or compare_trains without ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit usage context: use with the opaque trainId returned by search_trains, and warns not to construct IDs manually. It doesn't explicitly rule out alternatives, but the instruction is clear enough for an agent to know when to invoke it versus other tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_journeysSearch transfer journeysARead-onlyIdempotent
Use for routes that may include transfers, not for an individual train. The Shinkansen-first v0.1 provider reports this capability as unsupported rather than returning direct trains under the wrong concept.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| operators | No | ||
| toStationId | Yes | Canonical ID returned by search_stations. | |
| serviceTypes | No | ||
| fromStationId | Yes | Canonical ID returned by search_stations. | |
| departureAfter | No | ||
| departureBefore | No | ||
| includeNonShinkansen | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| journeys | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover read-only, idempotent, open-world, and non-destructive behavior. The description adds a valuable behavioral detail beyond those: the Shinkansen-first provider reports journey search as unsupported instead of incorrectly returning direct trains. This helps agents interpret empty or error responses correctly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences deliver the core usage rule and a provider-specific caveat with no filler. The most important guidance is front-loaded, making the description easy to scan and act on.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The selection context is strong and the output schema covers return values, but the tool has 8 parameters with only 25% schema coverage. The description does not compensate for that gap, leaving several parameter semantics unexplained for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25%, covering just fromStationId and toStationId. The description provides no explanation of operators, serviceTypes, includeNonShinkansen, departureAfter, or departureBefore, so an agent has little guidance for correctly setting most parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific, actionable rule: use this tool for routes that may include transfers, not for an individual train. This clearly separates it from search_trains and other sibling tools. The provider caveat reinforces the tool's unique role rather than blurring it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit when-to-use guidance (routes with transfers) and an explicit when-not-to-use boundary (not for an individual train). It does not name search_trains as the alternative, but the exclusion is strong enough that an agent can infer the correct routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_stationsSearch Japanese railway stationsARead-onlyIdempotent
Use this before search_trains whenever no canonical station ID is known. Returns candidates for Japanese, English, and common romanized names without silently resolving ambiguous inputs such as Osaka or Fukuoka.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| stations | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=true, and destructiveHint=false. The description adds behavioral context by stating it 'returns candidates' and explicitly says it does not silently resolve ambiguous inputs—this tells the agent to expect multiple results for ambiguous queries, which is not captured in annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero waste: the first delivers the usage directive, the second describes behavior. It is front-loaded with the most important instruction and stays compact.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple 2-parameter schema, annotations that cover safety, and an existing output schema (which defines return values), the description covers the essential ambiguity-handling behavior. It does not explain how to use the returned candidates (e.g., passing a station ID to search_trains), but that is adequately implied by the 'use before search_trains' directive. This is complete enough for an agent to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains the query parameter implicitly as a station name in Japanese, English, or romanized form, but it never mentions the 'limit' parameter at all. Since limit is optional with a default, the omission is less critical, but for a tool with only two parameters, the description should clarify both to fully address parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns station name candidates for Japanese, English, and romanized queries, and explicitly distinguishes it from the sibling search_trains by positioning it as a pre-step when no station ID is known. The verb 'Returns' and resource 'Japanese railway stations' give a precise purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use this before search_trains whenever no canonical station ID is known' gives an explicit when-to-use directive, and the note about not silently resolving ambiguous inputs (e.g., Osaka, Fukuoka) further clarifies the appropriate context. However, it does not explicitly state when to avoid this tool beyond 'when ID is known', which is implied but not explicitly framed as an exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_trainsSearch direct Shinkansen trainsARead-onlyIdempotent
Use after resolving both station IDs. Searches direct Shinkansen services only, never transfer journeys. Requires an explicit date; optional time, service, and operator filters are applied before pagination.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| limit | No | ||
| offset | No | ||
| operators | No | ||
| toStationId | Yes | Canonical ID returned by search_stations. | |
| serviceTypes | No | ||
| fromStationId | Yes | Canonical ID returned by search_stations. | |
| departureAfter | No | ||
| departureBefore | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| limit | Yes | |
| total | Yes | |
| offset | Yes | |
| trains | Yes | |
| hasMore | Yes | |
| returned | Yes | |
| nextOffset | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover read-only, idempotent, non-destructive behavior, so the description adds value with non-trivial behavioral detail: filters are applied before pagination and only direct services are returned. No contradiction with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences contain the prerequisite, core scope, required input, and filter/pagination behavior with no filler. The most important usage constraint is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is nearly complete for a read-only search tool: it covers prerequisites, scope, required date, optional filters, and filter-pagination ordering, while the output schema covers return details. It could be slightly stronger by naming the sibling for transfer journeys.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With schema description coverage at only 22%, the description must compensate. It groups optional filters into 'time, service, and operator' and notes they apply before pagination, but it does not map them to departureAfter/departureBefore, serviceTypes, and operators or explain their value semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Searches direct Shinkansen services only, never transfer journeys.' This clearly identifies the tool's scope and semantically differentiates it from transfer-search siblings such as search_journeys.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit sequencing ('Use after resolving both station IDs') and a clear exclusion ('never transfer journeys'), plus a required date. It does not name an alternative tool for transfer searches, so it falls just short of fully explicit sibling routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
compare_trains - First observed
get_availability - First observed
get_provider_status - First observed
get_train_details - First observed
search_journeys - First observed
search_stations - First observed
search_trains
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: provider status, station search, direct train search, journey search with transfers, train details, availability check, and comparison. No two tools overlap in function; even search_trains and search_journeys are explicitly separated by transfer handling.
All tool names follow a consistent verb_noun pattern (get_, search_, compare_) with snake_case throughout. The naming is predictable and aligns with the domain verbs expected (get, search, compare).
With 7 tools, the server is well-scoped for a read-only Japan rail information service. Each tool covers a distinct aspect of the domain without unnecessary duplication, fitting the typical 3-15 tool range perfectly.
The tool surface covers the core journey: station lookup, train search (direct and transfers), train details, availability, and comparison. Minor gaps exist like a dedicated fare breakdown or station details, but the essential read-only workflow is fully supported.
Maintenance
Related MCP Connectors
Deep, obscure Japanese station, accessibility & hazard data for AI agents. English-first.
Read-only public transit departures, stop search, and city coverage for bus and train users.
- potto-japanOAuthapp.potto
Authoritative JLPT-graded Japanese dataset (kanji, vocab, grammar, history) via MCP and REST.
Read-only index to Japanese election data, official sources, relations and scoped search history.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time Dutch Railways (NS) data for journey planning, live departures, disruptions, and station search.3-
- AlicenseBqualityDmaintenanceEnables route planning and transit information retrieval for Japan using the public Transit API. Supports searching stations, planning routes, and checking departures.101MIT
- FlicenseNot gradedqualityCmaintenanceProvides live UK rail data including station search, departures, arrivals, service details, and pre-filled Trainline booking links.-
- AlicenseAqualityCmaintenanceEnables AI assistants to answer questions about Japan's railway network with accurate track-connection data, including station neighbors and local subgraphs for all 9,043 stations nationwide.2MIT