Skip to main content
Glama

get_connections

Find train and bus connections between Swiss locations. Specify departure and arrival points with optional date, time, and connection limits.

Instructions

Get train/bus connections between two Swiss locations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesDeparture station/address
toYesArrival station/address
dateNoDate YYYY-MM-DD (default: today)
timeNoTime HH:MM (default: now)
limitNoNumber of connections (1-16, default: 4)
isArrivalTimeNoTrue if time is arrival time

Implementation Reference

  • Handler logic for the 'get_connections' tool, which fetches connection data from an external API and transforms it.
    case "get_connections": {
      const url = buildUrl(`${BASE}/connections`, {
        from: args.from as string,
        to: args.to as string,
        date: args.date as string,
        time: args.time as string,
        limit: args.limit as number,
        isArrivalTime: args.isArrivalTime ? 1 : undefined,
      });
      const data = await fetchJSON<{ connections: Connection[] }>(url);
      return JSON.stringify(data.connections.map(slimConnection));
    }
  • Input schema definition for 'get_connections'.
      name: "get_connections",
      description: "Get train/bus connections between two Swiss locations",
      inputSchema: {
        type: "object",
        required: ["from", "to"],
        properties: {
          from: { type: "string", description: "Departure station/address" },
          to: { type: "string", description: "Arrival station/address" },
          date: { type: "string", description: "Date YYYY-MM-DD (default: today)" },
          time: { type: "string", description: "Time HH:MM (default: now)" },
          limit: { type: "number", description: "Number of connections (1-16, default: 4)" },
          isArrivalTime: { type: "boolean", description: "True if time is arrival time" },
        },
      },
    },
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 states the tool's function but doesn't describe response format, error conditions, rate limits, authentication needs, or data freshness. For a read operation with 6 parameters, this leaves significant behavioral gaps.

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 with zero wasted words. It's appropriately sized for a straightforward query tool and front-loads the essential information without unnecessary elaboration.

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?

For a read-only query tool with full schema coverage but no output schema, the description adequately states the purpose but lacks information about return values, error handling, or data limitations. It's minimally complete but leaves the agent guessing about the response structure.

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?

Schema description coverage is 100%, so the schema fully documents all 6 parameters with clear descriptions and defaults. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation when schema coverage is complete.

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 specific action ('Get') and resource ('train/bus connections between two Swiss locations'), distinguishing it from sibling tools like get_departures or get_arrivals that focus on single locations. It precisely identifies the transportation modes and geographical scope.

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?

No guidance is provided on when to use this tool versus alternatives like get_departures or get_arrivals, nor any prerequisites or constraints beyond what's implied by the parameters. The description lacks explicit usage context or exclusions.

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/vikramgorla/mcp-swiss'

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