Skip to main content
Glama

next_trains

Retrieve upcoming Caltrain departures between any two stations, with an optional departure time.

Instructions

Return the next few scheduled Caltrain departures.

Args: origin: Station name (e.g. 'San Jose Diridon', 'Palo Alto', 'San Francisco'). Supports common abbreviations like 'SF' for San Francisco, 'SJ' for San Jose. If station is not found, use list_stations() to see all available options. destination: Station name (e.g. 'San Francisco', 'Mountain View', 'Tamien'). Supports common abbreviations like 'SF' for San Francisco, 'SJ' for San Jose. If station is not found, use list_stations() to see all available options. when_iso: Optional ISO-8601 datetime (local time). Default: now.

Note: If you get a "Station not found" error, try using the list_stations() tool first to see exact station names, then retry with the correct spelling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originYes
destinationYes
when_isoNo
Behavior4/5

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

With no annotations, description carries full burden. It discloses error handling ('Station not found' leads to list_stations) and notes default time behavior. Could add more on return format or rate limits, but covers key traits.

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?

Description is front-loaded with purpose, then breaks into args with docstring style, and ends with a helpful note. Slightly verbose but efficient for the complexity. Could merge the last sentence into args section.

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 no output schema and 3 parameters, description covers key aspects: purpose, parameters, error handling, and sibling reference. Lacks explicit mention of output structure (e.g., list of departure times), but the phrase 'next few scheduled Caltrain departures' implies a list, which is sufficient.

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 coverage is 0%, so description must compensate. It fully explains 'origin' and 'destination' with station name examples and abbreviations, and 'when_iso' with ISO-8601 format and default. Adds practical tips for misspellings.

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 'the next few scheduled Caltrain departures', with specific verb and resource. It distinguishes from sibling 'list_stations' by focusing on departures between two stations.

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?

Explicitly explains when to use this tool (for departures), provides alternative when station not found ('use list_stations()'), and gives examples of acceptable inputs. No ambiguity about usage context.

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/davidyen1124/caltrain-mcp'

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