Skip to main content
Glama
mirodn

mcp-server-public-transport

no_trip

Plan door-to-door public transport trips between two European locations using NSR IDs. Get route options with departure times and results customization.

Instructions

Door-to-door trip planning between two StopPlaces (NSR IDs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_idYes
to_idYes
date_timeNo
resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main asynchronous handler function for the 'no_trip' tool. It validates inputs, constructs a GraphQL query for Entur's Journey Planner, and fetches trip patterns between from_id and to_id stop places.
    async def no_trip(from_id: str, to_id: str, date_time: str | None = None, results: int | None = 5) -> dict[str, object]:
        """
        Args:
            from_id: NSR ID for origin (e.g., 'NSR:StopPlace:58368').
            to_id: NSR ID for destination.
            date_time: ISO 8601 datetime (e.g., '2025-08-23T12:00:00+02:00'). Optional.
            results: Number of trip patterns. Default: 5.
        Returns:
            GraphQL `data` with trip -> tripPatterns -> legs.
        """
        if not from_id or not to_id:
            raise ValueError("'from_id' and 'to_id' are required.")
    
        query = """
        query PlanTrip($from: String!, $to: String!, $results: Int!, $dateTime: DateTime) {
          trip(
            from: { place: $from }
            to:   { place: $to }
            numTripPatterns: $results
            dateTime: $dateTime
          ) {
            tripPatterns {
              duration
              walkDistance
              legs {
                mode
                distance
                aimedStartTime
                expectedStartTime
                aimedEndTime
                expectedEndTime
                fromPlace { name }
                toPlace { name }
                line { id name publicCode transportMode }
              }
            }
          }
        }
        """
        variables = {
            "from": from_id.strip(),
            "to": to_id.strip(),
            "results": int(results or 5),
            "dateTime": date_time,  # may be None
        }
        logger.info(
            "🇳🇴 Entur trip: %s -> %s (results=%s, dateTime=%s)",
            variables["from"], variables["to"], variables["results"], variables["dateTime"]
        )
        return await _post_graphql(query, variables)
  • tools/no.py:215-218 (registration)
    MCP tool registration decorator specifically for 'no_trip', including name and description.
    @mcp.tool(
        name="no_trip",
        description="Door-to-door trip planning between two StopPlaces (NSR IDs)."
    )
  • Docstring within the handler defining input parameters (from_id, to_id, date_time, results) and output (GraphQL data with tripPatterns).
    """
    Args:
        from_id: NSR ID for origin (e.g., 'NSR:StopPlace:58368').
        to_id: NSR ID for destination.
        date_time: ISO 8601 datetime (e.g., '2025-08-23T12:00:00+02:00'). Optional.
        results: Number of trip patterns. Default: 5.
    Returns:
        GraphQL `data` with trip -> tripPatterns -> legs.
    """
  • Module docstring listing the function signature and defaults for no_trip.
    - no_trip(from_id, to_id, date_time=None, results=5)
  • tools/no.py:316-316 (registration)
    Includes 'no_trip' in the list of registered tool names returned by register_no_tools.
    return ["no_search_places", "no_stop_departures", "no_trip", "no_nearest_stops"]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'door-to-door trip planning' but doesn't clarify if this includes real-time data, estimated times, cost, accessibility options, or error handling. For a trip planning tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, efficient sentence that front-loads the core functionality without any wasted words. It's appropriately sized for the tool's complexity.

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?

Given the tool has an output schema (which should cover return values), no annotations, and low schema coverage, the description is incomplete. It lacks details on behavioral traits, parameter meanings, and usage context, but the presence of an output schema mitigates some gaps, making it minimally 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?

The schema description coverage is 0%, meaning parameters are undocumented in the schema. The description mentions 'two StopPlaces (NSR IDs)', which hints at 'from_id' and 'to_id', but doesn't explain what NSR IDs are, their format, or the optional 'date_time' and 'results' parameters. It adds minimal value beyond the schema.

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 the tool's purpose as 'door-to-door trip planning between two StopPlaces (NSR IDs)', which specifies the verb ('trip planning'), resource ('StopPlaces'), and scope ('door-to-door'). However, it doesn't explicitly differentiate from sibling tools like 'be_search_connections' or 'ch_search_connections', which may offer similar functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'be_search_connections' or 'ch_search_connections', nor does it mention prerequisites or exclusions. It only states what the tool does, not when it's appropriate.

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/mirodn/mcp-server-public-transport'

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