Skip to main content
Glama
belgrano9

SNCF MCP Server

by belgrano9

SNCF MCP Server ๐Ÿš„

A Model Context Protocol (MCP) server for querying SNCF (French national railway) train schedules using the official Navitia API. Integrates seamlessly with Claude Desktop and other MCP-compatible clients.

Python 3.12+ FastMCP License: MIT

โœจ Features

  • ๐Ÿ” Search trains between any two French cities with real-time data

  • ๐Ÿš‰ Find stations in any city across France

  • ๐Ÿ“… Flexible date parsing - accepts ISO, European, and written date formats

  • โšก Real-time data - uses official SNCF Navitia API with live timetables

  • ๐ŸŽฏ Smart journey planning - shows transfers, duration, and route details

  • ๐ŸŒ International routes - supports cross-border journeys (e.g., Paris-Munich)

  • ๐Ÿ› ๏ธ Claude Desktop ready - works out of the box with MCP clients

Related MCP server: NS Travel MCP Server

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.12 or higher

  • uv (recommended) or pip

  • SNCF API key (free registration)

Installation

  1. Clone the repository

    git clone https://github.com/belgrano9/sncf_mcp_server.git
    cd sncf_mcp_server
  2. Install dependencies

    uv sync
  3. Get your SNCF API key

  4. Configure environment variables

    Create a .env file in the project root:

    SNCF_API=your-api-key-here

    โš ๏ธ IMPORTANT: Never commit your .env file! It's already in .gitignore.

  5. Test the server

    uv run server.py

๐Ÿ“– Usage

Standalone Testing

Test the search functionality directly in Python:

from server import search_trains, find_station

# Search for trains
result = search_trains("Paris", "Lyon", "2025-11-20 14:00")
print(result)

# Find a station
stations = find_station("Paris")
print(stations)

Or use the included Jupyter notebook (test_notebook.ipynb) for interactive testing.

Claude Desktop Integration

Add to your Claude Desktop config file:

Windows (%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "sncf": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\Users\\YourName\\path\\to\\sncf_mcp_server",
        "run",
        "server.py"
      ]
    }
  }
}

macOS (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "sncf": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/sncf_mcp_server",
        "run",
        "server.py"
      ]
    }
  }
}

Linux (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "sncf": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/sncf_mcp_server",
        "run",
        "server.py"
      ]
    }
  }
}

Restart Claude Desktop, and you can ask:

  • "Show me trains from Paris to Lyon tomorrow at 2pm"

  • "What's the earliest train from Paris Gare de l'Est to Munich tomorrow?"

  • "Find all train stations in Paris"

  • "How long does it take to get from Bordeaux to Marseille?"

๐Ÿ› ๏ธ MCP Tools

1. search_trains

Find trains between two stations with real-time data.

Parameters:

  • origin (string): Origin station/city name (e.g., "Paris", "Lyon", "Paris Gare de l'Est")

  • destination (string): Destination station/city name (e.g., "Mรผnchen Hbf", "Barcelona")

  • departure_datetime (string, optional): Travel date/time in flexible formats:

    • ISO: "2025-11-28 08:00" (recommended)

    • European: "28/11/2025 08:00"

    • Written: "November 28, 2025 8:00am"

    • Default: current time

Example Output:

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
    SNCF JOURNEY SEARCH
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ” Searched for 'Paris Est':
  โœ“ Paris Gare de l'Est (ID: stop_area:SNCF:...)
    Paris - Bercy (ID: stop_area:SNCF:...)
    Paris Montparnasse (ID: stop_area:SNCF:...)

โ†’ Selected: Paris Gare de l'Est

๐Ÿ” Searched for 'Mรผnchen Hbf':
  โœ“ Mรผnchen Hauptbahnhof (ID: stop_area:OCE:...)

โ†’ Selected: Mรผnchen Hauptbahnhof

๐Ÿ“… Searching for trains departing after: 2025-11-28 08:00
๐Ÿ”„ API datetime format: 20251128T080000

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿš„ AVAILABLE TRAINS
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Found 5 journey option(s):

  1. Depart: 2025-11-28 08:55 โ†’ Arrive: 2025-11-28 14:54
     Duration: 5h 59min | Direct

  2. Depart: 2025-11-28 10:55 โ†’ Arrive: 2025-11-28 16:54
     Duration: 5h 59min | Direct

  3. Depart: 2025-11-28 12:55 โ†’ Arrive: 2025-11-28 19:18
     Duration: 6h 23min | 1 change(s)
     Route: Paris Gare de l'Est โ†’ Stuttgart Hbf | Stuttgart Hbf โ†’ Mรผnchen Hbf

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

2. find_station

Search for train stations in a city or by name.

Parameters:

  • station_name (string): Station/city name to search (e.g., "Paris", "Lyon Part-Dieu")

Example Output:

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
    STATION SEARCH
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ” Searched for 'Paris':
  โœ“ Paris Gare de Lyon (ID: stop_area:SNCF:87686006)
    Paris Montparnasse (ID: stop_area:SNCF:87391003)
    Paris Gare du Nord (ID: stop_area:SNCF:87271007)

โ†’ Selected: Paris Gare de Lyon

โœ… Best match: Paris Gare de Lyon
   ID: stop_area:SNCF:87686006

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

3. get_train_prices โš ๏ธ EXPERIMENTAL

Educational Proof of Concept Only - May Not Work

Attempts to scrape price information from SNCF's booking system.

โš ๏ธ IMPORTANT DISCLAIMERS:

  • This is an experimental feature for educational purposes only

  • May violate SNCF's Terms of Service

  • Likely blocked by anti-scraping measures (403 Forbidden)

  • NOT recommended for production use

  • For real pricing, use commercial APIs (Lyko, Trainline) or SNCF Connect website

Parameters:

  • origin (string): Origin station/city name

  • destination (string): Destination station/city name

  • departure_datetime (string, optional): Travel date/time (same formats as search_trains)

  • page (integer, optional): Page number (default: 1)

  • per_page (integer, optional): Results per page (default: 5, max: 20)

Example Output (if it worked):

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  SNCF PRICE CHECK (EXPERIMENTAL)
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โš ๏ธ  WARNING: Experimental feature
    May not work due to anti-scraping measures
    For educational purposes only

๐Ÿ“ Route: Paris Gare de Lyon โ†’ Marseille Saint-Charles
๐Ÿ“… Date: 2025-11-17

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Attempting to fetch prices...
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โŒ Price check failed: Access forbidden - anti-scraping measures detected

This feature is experimental and may not work.
For real pricing, please visit:
- SNCF Connect: https://www.sncf-connect.com
- Or use commercial API providers

Why This Probably Won't Work:

  • SNCF employs anti-scraping measures (403 Forbidden)

  • Requires reverse-engineering their booking API

  • API structure is proprietary and undocumented

  • May violate Terms of Service

Recommended Alternatives for Production:

See sncf_scraper/README.md for technical details and ethical considerations.

๐Ÿ—๏ธ Architecture

sncf_mcp_server/
โ”œโ”€โ”€ server.py              # FastMCP server implementation
โ”œโ”€โ”€ price_checker.py       # Price scraping wrapper (experimental)
โ”œโ”€โ”€ pyproject.toml         # Dependencies & project config
โ”œโ”€โ”€ .env                   # API key (not committed)
โ”œโ”€โ”€ .gitignore             # Git ignore rules
โ”œโ”€โ”€ README.md              # This file
โ”œโ”€โ”€ test_notebook.ipynb    # Jupyter notebook for testing
โ”œโ”€โ”€ sncf_scraper/          # Price scraper module (experimental)
โ”‚   โ”œโ”€โ”€ __init__.py          # Module exports
โ”‚   โ”œโ”€โ”€ models.py            # TrainOffer, PriceSearchResult models
โ”‚   โ”œโ”€โ”€ scraper.py           # SNCFPriceScraper implementation
โ”‚   โ””โ”€โ”€ README.md            # Scraper documentation & disclaimers
โ””โ”€โ”€ tests/                 # Test suite
    โ”œโ”€โ”€ test_simple.py         # Simple train search test
    โ”œโ”€โ”€ test_pagination.py     # Pagination feature test
    โ”œโ”€โ”€ test_search.py         # MCP wrapper test
    โ”œโ”€โ”€ test_price_scraper.py  # Price scraper tests (experimental)
    โ”œโ”€โ”€ debug_*.py             # Debug/diagnostic scripts
    โ”œโ”€โ”€ run_all_tests.py       # Test runner
    โ””โ”€โ”€ README.md              # Test documentation

How It Works

  1. Station Search: Queries Navitia API's /places endpoint with fuzzy matching

  2. Journey Planning: Uses /journeys endpoint with origin, destination, and datetime

  3. Date Parsing: Flexible parser handles multiple date/time formats

  4. Response Formatting: Returns human-readable journey information with:

    • Departure and arrival times

    • Journey duration

    • Number of transfers

    • Route details for multi-leg journeys

Key Implementation Details

  • โœ… Real-time data (no local database needed)

  • โœ… Flexible date parsing with python-dateutil

  • โœ… European date format support (day-first parsing)

  • โœ… Automatic station ID resolution from city names

  • โœ… Shows top 3 station matches for transparency

  • โœ… Handles both domestic and international routes

  • โœ… Transfer information with route breakdown

  • โœ… Pagination support - Returns 10 results per page (up to 100 journeys)

  • โœ… Comprehensive test suite - See tests/README.md

๐ŸŒ Supported Routes

The server supports any route in the SNCF/Navitia network:

  • High-Speed (TGV): Paris-Lyon, Paris-Marseille, Paris-Bordeaux, Paris-Strasbourg

  • International: Paris-London (Eurostar), Paris-Munich, Paris-Barcelona, Paris-Brussels

  • Long-Distance (Intercitรฉs): Regional connections across France

  • TER (Regional Express): Local services

  • Cross-border: Connections to Germany, Italy, Spain, Switzerland, Belgium

Major Cities:

  • Paris (multiple stations: Gare du Nord, Gare de Lyon, Montparnasse, Est, Austerlitz, Saint-Lazare, Bercy)

  • Lyon, Marseille, Bordeaux, Toulouse

  • Strasbourg, Nantes, Nice, Lille

  • International: London, Munich, Barcelona, Brussels, Geneva, Milan

  • 1000+ stations across France and Europe!

Use find_station to discover available stations in any city.

๐Ÿ”ง Development

Project Setup

# Clone and install
git clone https://github.com/belgrano9/sncf_mcp_server.git
cd sncf_mcp_server
uv sync

# Set up your API key in .env
echo "SNCF_API=your-api-key-here" > .env

# Run the server
uv run server.py

# Or use FastMCP dev mode
fastmcp dev server.py

Dependencies

  • fastmcp - MCP server framework

  • requests (>=2.32.5) - HTTP client for API calls

  • python-dotenv (>=1.2.1) - Environment variable management

  • python-dateutil - Flexible date/time parsing

  • httpx (>=0.28.1) - Async HTTP client

  • loguru (>=0.7.3) - Logging

  • rich (>=14.2.0) - Terminal formatting

File Structure

  • server.py - Main MCP server with search_trains and find_station tools

  • .env - API key configuration (never commit!)

  • test_notebook.ipynb - Interactive testing notebook

  • tests/ - Test suite (see tests/README.md)

Testing

Run the test suite to verify everything works:

# Run all tests
uv run tests/run_all_tests.py

# Run individual tests
uv run tests/test_simple.py       # Simple train search
uv run tests/test_pagination.py   # Pagination feature
uv run tests/debug_env2.py         # Environment check

See tests/README.md for detailed test documentation.

๐Ÿ“ Data Source

Real-time data from SNCF Navitia API:

  • API Base URL: https://api.sncf.com/v1

  • Authentication: HTTP Basic Auth (API key as username)

  • Coverage: SNCF network across France and international connections

  • Update Frequency: Real-time (no manual updates needed)

  • Format: JSON responses

  • Documentation: Navitia API Docs

Getting an API Key

  1. Visit SNCF Digital

  2. Create an account

  3. Request access to the Navitia API

  4. Copy your API key to .env

๐Ÿ› Known Issues

  • Windows console may show encoding errors with Unicode characters (functionality not affected)

  • Station name matching uses first result - use find_station for ambiguous names

  • International routes may have limited availability depending on API coverage

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

Ideas for Contributions

  • Add price information (if available in API)

  • Support for train status/real-time delays

  • Multi-leg journey optimization

  • Visualization of routes on maps

  • Additional query filters (train type, max transfers, etc.)

  • Support for round-trip queries

  • Save favorite routes

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • SNCF for providing the Navitia open API

  • FastMCP by @jlowin for the excellent MCP framework

  • Anthropic for Claude and the Model Context Protocol

  • Navitia for powering the transit data API

๐Ÿ“ฎ Support


Built with โค๏ธ using FastMCP and Claude

Voyagez intelligent, voyagez en train! ๐Ÿš„

Available Tools

3 tools
find_stationA

Search for a train station by name and return matching options.

Useful for checking station names before searching for journeys, or when you're not sure of the exact station name.

Args: station_name: Station name to search for (e.g., "Paris", "Munich", "Lyon")

Returns: A formatted string showing matching stations with their IDs and full names.

ParametersJSON Schema
NameRequiredDescriptionDefault
station_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states that it returns matching options as 'a formatted string showing matching stations with their IDs and full names,' and notes it's useful for checking station names. This provides a decent picture of the operation and output, though it doesn't explicitly mention non-destructive behavior or edge cases like no results.

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 concise and well-structured, with the main purpose stated in the first sentence, followed by usage context and a structured 'Args' and 'Returns' section. Every sentence adds value with no repetition or 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 simple tool with one parameter and an output schema, the description covers purpose, usage context, parameter semantics, and return format. It provides enough information for an agent to select and invoke the tool correctly without confusion, making it complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema only provides the parameter name and type, with 0% description coverage. The description compensates fully by including an 'Args' section that explains station_name with concrete examples ('Paris', 'Munich', 'Lyon'), making the parameter's meaning and expected format clear.

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's function: 'Search for a train station by name and return matching options.' This uses a specific verb and resource, and it distinguishes itself from sibling tools like search_trains (which searches journeys) and get_train_prices (which gets prices).

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 explicitly says it is 'Useful for checking station names before searching for journeys, or when you're not sure of the exact station name,' which gives clear context for when to use it. It doesn't explicitly name alternatives, but the context implies it should be used before journey searches, which is clear enough.

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

get_train_pricesA

Get train prices (EXPERIMENTAL - Educational Proof of Concept).

โš ๏ธ WARNING: This is an experimental feature that attempts to scrape prices from SNCF. It may not work due to:

  • Anti-scraping measures

  • API changes

  • Terms of Service restrictions

For production use, consider:

  • Lyko SNCF Connect API

  • Trainline API

  • Official SNCF partnerships

Args: origin: Origin station name (e.g., "Paris", "Lyon") destination: Destination station name (e.g., "Marseille") departure_datetime: Date/time in flexible formats (default: today) page: Page number for pagination (default: 1) per_page: Results per page (default: 5, max: 20)

Returns: Formatted string with price information (if available)

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNo
originYes
per_pageNo
destinationYes
departure_datetimeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it 'attempts to scrape prices' and may fail due to anti-scraping measures, API changes, or ToS restrictions. It also notes that returns are 'if available', setting accurate expectations. This is highly transparent.

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 well-structured with a front-loaded warning, a list of alternatives, an Args section, and a Returns section. Every sentence adds value, and the format is clear despite being slightly verbose due to the necessary experimental warnings.

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 an experimental scraping tool, the description covers all necessary aspects: what it does, its limitations, all parameters, and the return format. It is self-contained and provides enough context for an agent to invoke it correctly, even without annotations.

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 description thoroughly explains every parameter with examples and defaults, compensating for 0% schema coverage. However, there is a minor inconsistency: departure_datetime is described as 'default: today' while the schema default is null, which could cause minor confusion.

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 purpose: 'Get train prices' with explicit scope ('from SNCF'). It distinguishes itself from sibling tools like 'search_trains' and 'find_station' by focusing on price retrieval, and adds context as an 'Educational Proof of Concept'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description is explicit about when to use it (educational/testing) and explicitly warns against production use, offering concrete alternatives (Lyko SNCF Connect API, Trainline API, official SNCF partnerships). This provides clear when-to-use and when-not-to-use guidance.

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

search_trainsA

Search for train journeys between two stations with pagination.

Args: origin: Starting station name (e.g., "Paris Est", "Lyon") destination: Destination station name (e.g., "Mรผnchen Hbf", "Barcelona") departure_datetime: Optional datetime. Accepts flexible formats: - ISO: "2025-11-28 08:00" (RECOMMENDED) - European: "28/11/2025 08:00" - Written: "November 28, 2025 8:00am" If not provided, searches from current time. page: Page number for pagination (default: 1). Shows 10 results per page. Request different pages to see more trains (e.g., page=2, page=3).

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNo
originYes
destinationYes
departure_datetimeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries full burden. It discloses default behavior for missing departure_datetime (searches from current time), pagination default of 10 results per page, and the need to request different pages. It also explains flexible date formats, offering rich behavioral context.

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 well-structured as a docstring with a one-line summary followed by per-parameter explanations. Each entry is concise yet informative, with no wasted words.

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?

The description covers all four parameters, explains default behaviors, and provides usage context. Since an output schema exists, return values need not be described. This is complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 explain each parameter. It does so thoroughly: origin and destination include examples, departure_datetime lists multiple accepted formats and default behavior, and page explains the default and result count. This adds substantial meaning beyond the bare schema.

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 'Search for train journeys between two stations with pagination,' clearly identifying the action (search), resource (train journeys), and key behavior (pagination). This distinguishes it from sibling tools like find_station and get_train_prices.

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 provides a clear context for when to use the toolโ€”searching train journeys between two stationsโ€”but does not explicitly state when-not-to-use it or mention alternative tools. This matches 'clear context, no exclusions'.

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. 3 tool updatesv0.1.0
    • First observedfind_station
    • First observedget_train_prices
    • First observedsearch_trains

TDQS

A4.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: search_trains finds journeys, find_station resolves station names, and get_train_prices retrieves pricing. Although search_trains and get_train_prices share origin/destination parameters, their descriptions and return types make them unambiguous.

Naming Consistency5/5

All tool names follow the verb_noun pattern with lowercase and underscores: search_trains, find_station, get_train_prices. This is consistent and predictable.

Tool Count5/5

With 3 tools, the server is minimal but well-scoped for train journey searching. Each tool serves a necessary function and there is no redundancy.

Completeness4/5

The server covers the core workflow: station lookup, journey search, and price lookup. Missing booking or real-time status, but these are beyond the apparent scope. The experimental nature of get_train_prices introduces some uncertainty, but the surface is otherwise complete for planning.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers