Skip to main content
Glama
belgrano9

Renfe MCP Server

by belgrano9

get_train_prices

Check real-time train ticket prices for routes in Spain. Uses web scraping to provide actual pricing with pagination support.

Instructions

Check actual ticket prices for trains between two cities using web scraping with pagination.

NOTE: This tool scrapes the Renfe website and may take a few seconds to complete. It complements the search_trains tool by providing real-time price information. This endpoint has stricter rate limits due to web scraping.

Args: origin: Starting city name (e.g., "Madrid", "Barcelona", "Valencia") destination: Destination city name (e.g., "Madrid", "Barcelona", "Sevilla") date: Travel date. Accepts flexible formats: - ISO: "2025-11-28" (RECOMMENDED) - European: "28/11/2025" - Written: "November 28, 2025" or "28 November 2025" If not provided, checks prices for today's date. page: Page number to display (default: 1) per_page: Number of results per page (default: 5, max: 20) api_key: API key for authentication (optional if configured via environment)

Returns: Formatted string with train prices, availability, and booking information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originYes
destinationYes
dateNo
pageNo
per_pageNo
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses scraping behavior, potential delays, rate limits, pagination, and the return format, giving the agent clear behavioral expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections but is slightly verbose. However, it efficiently front-loads the purpose and provides necessary parameter details without redundancy.

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?

Given no annotations and a missing output schema, the description comprehensively covers purpose, usage, behavior, and all parameters, leaving no critical gaps 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.

Parameters5/5

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

Since schema description coverage is 0%, the description adds essential meaning to all 6 parameters, including examples for origin/destination, detailed date formats, page/per_page defaults, and api_key usage.

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 checks actual ticket prices via web scraping with pagination, and distinguishes it from the sibling tool search_trains by noting it provides real-time price information.

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 mentions it complements search_trains and notes stricter rate limits, providing usage context. However, it does not explicitly state when not to use this tool or give alternatives beyond the sibling.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/belgrano9/renfe_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server