Skip to main content
Glama

japan-rail-mcp

japan-rail-mcp は、構造化された日本鉄道データを提供するための読み取り専用の Model Context Protocol(MCP)サーバーです。バージョン0.1は意図的に新幹線ファーストです。資格情報なしで利用できる便利な駅カタログを提供し、デプロイ所有者の Ekispert API Standard Plan キーを利用すれば、リアルタイムの新幹線時刻表、運賃、座席クラス、停車駅を照会できます。

このサーバーは、切符の予約、鉄道アカウントへのログイン、アクセス制御の回避、事業者Webサイトのスクレイピング、テストフィクスチャを実データとして提示することは一切行いません。

japan-rail-mcp は、china-rail-mcp と同じ概念インターフェースを共有するよう設計されており、長期的には、各国の鉄道MCPサーバー間で相互運用可能なスキーマを確立することを目指しています。

これは実験的な相互運用の取り決めであり、公式の鉄道規格やMCP標準ではありません。

機能

機能

APIキーなし

EKISPERT_API_KEY あり

日本語・英語・ローマ字による駅検索

対応。58駅を収録した新幹線中心のバンドルカタログ

対応

曖昧な駅候補の表示

対応

対応

新幹線の直通時刻表検索

明示的に非対応

対応。キーのプランに依存します

数値JPYでの運賃表示

明示的に非対応

対応

座席クラスの正規化

明示的に非対応

対応

停車順序の取得

明示的に非対応

対応

予約在庫・席空き状況

明示的に非対応

明示的に非対応

乗り換え経路検索

v0.1では明示的に非対応

v0.1では明示的に非対応

成功したすべてのデータには、情報出所のプロvenanceが含まれます。鉄道のタイムキーは日本のオフセット付きの明示的な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

名前を1つ以上の正規の jp:station:* IDに解決します。列車検索の前に使います。

search_trains

解決済みの2つの駅ID間で新幹線の直通列車を検索します。

get_train_details

search_trains が返す不透明な trainId の停車順を読み取ります。

get_availability

プロバイダーの対応状況を確認します。現在は、値を捏造せずに status: "unsupported" を返します。

compare_trains

主観的な推奨を交えずに、同一構造の直通列車候補を並べ替えます。

search_journeys

乗り換え経路用に予約済みです。v0.1では構造化された非対応エラーを返します。

すべてのツールは読み取り専用・非破壊・冪等であると明示されています。成功したすべてのツール結果には、人が読める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の契約にStandard Planの経路検索エンドポイントが含まれるアクセスキーが必要です。無料プランでは、この中核エンドポイントは提供されません。

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コマンドをCodexのMCP設定に登録するか、またはインストール済みのCodexバージョンがサポートするCLI形式を使用します:

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

ライブの列車データが必要な場合は、プロセス環境またはCodexのシークレット設定で EKISPERT_API_KEY を提供してください。

ツールの使用例

まずは駅の候補を解決します:

{
  "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駅を収録しています。現在の新幹線ネットワークに加えて、大阪、新宿エリアの駅、富山の福岡駅など、意図的に曖昧な比較用駅を数を含んでいます。含まれるのは駅のメタデータのみで、時刻表・運賃・空席情報はありません。事業者による路線図や旅行ページへのリンクは、データソースの評価 にあります。

Ekispert API

この任意のプロバイダーは、文書化されたエンドポイントとデプロイ所有者のアクセスキーを使用します。明示的な日付、下限時刻が指定されていない場合は午前0時、停車駅、座席クラス、事業者詳細をリクエストします。レスポンスには、ekispert-standard、エンドポイントのデータセット、取得時刻、リアルタイムステータス、プロバイダー契約境界が含まれます。

新幹線時刻表データに使用されていないソース

  • 現在の ODPT JR East の列車時刻表データセットは、新幹線を明示的に除外しています。

  • 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ハンドラーはツール呼び出しを検証し記述しますが、プロバイダーのデータを取得・解析はしません。機能の確認は、ネットワークアクセス前にフェイルクローズ(引締した動作の安全側)を行います。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 にあり、以下を含みます:

  • 新幹線の路線名とサービス名

  • プロバイダーの駅名

  • 旅客向けの列車番号と、運行上の識別子・プロバイダー識別子の比較

  • 日本語の座席ラベル。例として、自由席、指定席、グリーン車、グランクラス

これらの境界は、将来のスタンドアローン rail-mcp-spec の候補です。本リポジトリは、そのような標準がすでに存在することを示すものではありません。

制限事項

  • 資格情報が存在しないインストールは、駅検索のみを行います。

  • ライブ列車の動作は、フィクスチャによる契約テストがありますが、このリポジトリ内では実アカウントで検証されていません。フィクスチャの成功は、本番環境のプロバイダーアクセスが証明されるものではありません。

  • Ekispert Standard Planの内容、制限、表現の許可、商用利用、キャッシュ、再配布権利は、デプロイ所有者の契約に基づきます。

  • 検索結果は、リクエストごとにプロバイダーが返す最初の20件に限定されます。

  • search_trains は新幹線の直通運転のみを返します。乗り換えは静かに平らにしません。

  • 座席クラスと公表運賃は、空席不是在庫ではありません。get_availability は対応していないままです。

  • 運行の乱れやリアルタイムの列車位置は含まれません。

  • バンドル駅カタログは新幹線中心であり、全国の完全な駅データベースではありません。

  • 重要な旅程・運賃・乗車条件は、鉄道事業者または認可された予約チャネルで確認してください。

開発

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

テストでカバーしているのは、日本語/英語の駅名一致機能、曖昧さ、東京–新大阪のフィクスチャ解析、明示的な日付と東京タイムゾーンの境界、プロバイダーの障害、非対応の空席状況、MCP構造化出力、読み取り専用の注釈、Reusableの共有鉄道スキーマ契約です。

セキュリティと読み取り専用の範囲

チケット購入、予約、ログイン、決済、CAPTCHA、アカウント、データ操作を行うツールはありません。資格情報の取り扱い指針は SECURITY.md を参照してください。

ライセンス

プロジェクトのソースコードは MIT License の下で提供されています。このライセンスが適用されるのは、このリポジトリのソースコードのみであり、鉄道事業者のデータ、Ekispert のレスポンス、ODPTデータセット、GTFSフィード、各三者の商標を再配布権限を与えるものではありません。各データソースはそれぞれのユーザーの条件に従います。

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