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" },
        },
      },
    },

Tool Definition Quality

Score is being calculated. Check back soon.

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