Skip to main content
Glama

japan-rail-mcp

japan-rail-mcp 是一个面向结构化日本铁路数据的只读 Model Context Protocol 服务器。0.1 版本刻意采用**新干线优先(Shinkansen-first)**的设计:它提供一套不含凭据可用的车站目录,并可通过部署所有者的 Ekispert API Standard Plan 密钥查询实时新干线时刻表、票价、座位等级和停靠站。

该服务器不会预订车票、登录铁路账户、绕过访问控制、爬取运营商网站,也不会把测试夹具(test fixtures)当作实时数据展示。

japan-rail-mcp 的设计目标是与 china-rail-mcp 共享一套通用的概念接口,长期目标是建立跨越不同国家的铁路 MCP 服务器之间可互操作的模式。

这是一个实验性的互操作性约定,并不是官方的铁路标准或 MCP 标准。

功能

能力

无 API 密钥

使用 EKISPERT_API_KEY

日文、英文和罗马字车站搜索

支持,内置 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 工具

工具

适用场景

get_provider_status

在实时查询之前,检查已配置的提供方与能力边界。

search_stations

将名称解析为一个或多个规范化的 jp:station:* ID。应在列车搜索之前使用。

search_trains

在两个已解析的车站 ID 之间搜索直达新干线列车。

get_train_details

读取 search_trains 返回的不透明 trainId 的有序停靠站。

get_availability

检查提供方支持情况;目前返回 status: "unsupported",不会编造数字。

compare_trains

对同一个结构化直达列车候选项进行排序,不做主观推荐。

search_journeys

为换取路线保留;在 v0.1 中返回结构化的不支持错误。

每个工具都被标注为只读、非破坏性和幂等。每个成功的工具结果都包含人类可读的 JSON 文本,以及经过输出模式(schema)校验的 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

实时新干线数据

需要实时时刻表功能,必须具备提供方 Standard Plan 路线搜索端点的访问权限,这取决于部署所有者的 Ek HaS. 免费版方案不含有该核心端点。

export EKISPERT_API_KEY='your-own-key'
npm start

该密钥只会被发送到配置好的 Ekispert API 端点。它绝不会出现在各工具结果或出现在任一项 provider 错误中。项目中不含共享密钥,不会对 provider 数据的再授权,也不会绕过协议中附带的访问限制。

客户端配置

Claude Desktop

如果是本地 checkout 检查代码,可以添加类似下面的条目,并把其中的绝对路径替换为你自己的路径:

{
  "mcpServers": {
    "japan-rail": {
      "command": "node",
      "args": ["/absolute/path/to/japan-rail-mcp/dist/index.js"],
      "env": {
        "EKISPERT_API_KEY": "your-own-key"
      }
    }
  }
}

如果只做车站搜索,可省略 env。客户端较为稳定的密码管理机制更优于在配置仓库中提交密钥。

Codex

在 Codex 的 MCP 配置中注册已构建的 stdio 命令,或使用你安装的 Codex 版本所支持的 CLI 格式:

codex mcp add japan-rail -- node /absolute/path/to/japan-rail-mcp/dist/index.js

需要实时列车数据时,应通过进程环境或 Codex 的机密配置提供 EKISPERT_API_KEY。

工具示例

首先解析车站候选人:

{
  "query": "Osaka"
}

在有歧义的情况下,该结果会刻意同时适用于“大阪”(Osaka)和“新大阪”(Shin-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 个高价值车站:包括当前新干线网络,以及一小部分刻意带有歧义的对比车站,如大阪、新宿区域车站和位于富山的直丈「福冈」。该目录只包含车站元数据,不包含时刻表、票价或余票数据。运营商的路线图和旅行页面链接在数据来源评估 中。

Ekispert API

该可选提供方使用 文档化端点 以及部署所有者持有的访问密钥。它会显式请求日期,如果未提供时间下限,则明确请求特定时间、停靠站、座位类型和运营商详情等。响应中标识 ekispert-standard、端点数据集、检索时间、实时状态,以及 provider 协议的相应边界。

不用于新干线时刻表数据的来源

  • 当前 ODPT 的 JR East(JR东日本)列车时刻表数据集明确排除新干线。

  • GTFS-JP v4 是一种数据规格,而不是全国范围的数据流,也不是全面的数据授权。

  • JR 公开的时刻表页面和 PDF 未向本包提供通用 API 或再分发许可,因此既没有抓取,也不会打包。

详见 docs/data-sources.md 中的来源评估。

架构

MCP tools
  -> RailService
    -> StationCatalogProvider
       -> StaticShinkansenStationProvider
    -> RailDataProvider
       -> EkispertProvider (optional key)

core rail schemas
  + Japan extensions
  + provider-private parsing and identifiers

MCP 处理器会根据 schema 校验和描述工具调用,但不会真正抓取或解析 provider 数据。能力检查在网络出站之前以 fail-closed 方式失败并拦截。search_trains 表示一列直达的实体列车,而 search_journeys 表示可能包含换乘的行程。关于提取边界,具体信息可参考 docs/architecture.md。

与 china-rail-mcp 的关系

共用的工具名如下:

  • search_stations

  • search_trains

  • get_train_details

  • get_availability

  • compare_trains

各公共候选模式分别是 Station、StationRef、Train、Journey、Fare 和 SeatClass、SeatAvailability、Source、RailError 以及 RailProviderCapabilities。这个契约保留了紧凑 ISO 4217 的数值型票价、明确的区域本地偏移、来源信息、规范化车站 ID、代码能力检查,以及结构化错误。

日本特有内容则放在 extensions.japan 下面,包括:

  • 新干线线路与线路名称

  • provider 车站名称

  • 面向乘客的列车号与运营/提供方标识符

  • 日语座位标签,例如 自由席、指定席、グリーン車 和 グランクラス

以上这些边界可以成为未来独立 rail-mcp-spec 的候选内容,本仓库并不声称这样的规范已存在。

限制

  • 无凭据的安装包只能进行车站搜索。

  • 实时列车行为已有基于测试夹具(fixture)的契约测试,但本仓库中未用过真实账户进行验证。测试夹具通过不代表生产环境下提供方一定可用。

  • Ekispert Standard Plan 及其各自的流动性等边界、允许的表示、商业使用、缓存和再分发权利,需依赖用户与 it its與協議中的条款。

  • 每次请求的搜索结果受到限制,最多返回该 provider 已知的前最多 20 项结果。

  • search_trains 只返回直达新干线路;换乘不会静默转换或合并。

  • 座位等级和公布票价并不等于座位余票;get_availability 依旧不受支持。

  • 仅提供定位能力,同时不包含线路中断和实时位置等动态数据。

  • 内置车站目录以新干线为中心,并非是日本全国的完整车站数据库。

  • 重要旅行、票价以及购票条件必须与铁路运营商或授权渠道核对。

开发

npm install
npm run lint
npm run typecheck
npm test
npm run build
npm run format

测试覆盖了日文・英文车站匹配、歧义、东京 ⇄ 新大阪 fixture 解析、显式日期与东京时区边界、provider 故障、不支持 available、MCP 结构化输出、只读注解,以及可复用的共享 rail schema 契约。

安全性与只读范围

项目不包含任何购票、预订、登录、支付、CAPTCHA、账户或变更修改操作。有关 credential 处理的指南,参见 SECURITY.md。

许可证

本存储库中的源代码均依据 MIT License 发布。该许可证仅适用于本仓库自己的代码,不发生任何对其他数据的再授权,例如不代表对铁路运营方数据、Ekispert 响应、ODPT 数据集、GTFS feed 数据或第三方品牌商标的授权。每个数据源仍然适用其自身的条款。

Available Tools

7 tools
compare_trainsCompare direct Shinkansen trainsB
Read-onlyIdempotent

Use to sort structured direct-train candidates by departure, arrival, duration, or total fare. This tool does not make a subjective recommendation.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
limitNo
offsetNo
sortByNodeparture_time
operatorsNo
toStationIdYesCanonical ID returned by search_stations.
serviceTypesNo
fromStationIdYesCanonical ID returned by search_stations.
departureAfterNo
departureBeforeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
limitYes
totalYes
offsetYes
trainsYes
hasMoreYes
returnedYes
nextOffsetYes

TDQS

B3.2/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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 availabilityA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
trainIdYes
toStationIdYesCanonical ID returned by search_stations.
fromStationIdYesCanonical ID returned by search_stations.

Output Schema

ParametersJSON Schema
NameRequiredDescription
seatsNo
reasonNo
sourceNo
statusYes
retrievedAtYes

TDQS

A4.1/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 statusA
Read-onlyIdempotent

Use before live train queries to see which read-only capabilities are configured and why unavailable capabilities are disabled.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
notesYes
providerYes
configuredYes
capabilitiesYes

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 detailsA
Read-onlyIdempotent

Use with the opaque trainId returned by search_trains to retrieve that service and its ordered stops. Do not construct train IDs manually.

ParametersJSON Schema
NameRequiredDescriptionDefault
trainIdYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
stopsYes
trainYes
sourceYes

TDQS

A4.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 journeysA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
operatorsNo
toStationIdYesCanonical ID returned by search_stations.
serviceTypesNo
fromStationIdYesCanonical ID returned by search_stations.
departureAfterNo
departureBeforeNo
includeNonShinkansenNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
journeysYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 stationsA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
stationsYes

TDQS

A4.1/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 trainsA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
limitNo
offsetNo
operatorsNo
toStationIdYesCanonical ID returned by search_stations.
serviceTypesNo
fromStationIdYesCanonical ID returned by search_stations.
departureAfterNo
departureBeforeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
limitYes
totalYes
offsetYes
trainsYes
hasMoreYes
returnedYes
nextOffsetYes

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 7 tool updatesv0.1.0
    • First observedcompare_trains
    • First observedget_availability
    • First observedget_provider_status
    • First observedget_train_details
    • First observedsearch_journeys
    • First observedsearch_stations
    • First observedsearch_trains

TDQS

A4/5.0

Scored across 7 tools

Disambiguation5/5

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.

Naming Consistency5/5

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).

Tool Count5/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers