get_connections
Pack: swisstransport · Endpoint: https://gateway.pipeworx.io/swisstransport/mcp
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/get_connections for the schema, then POST the same URL with its arguments for the data.
Get public transport connections between two Swiss locations. Returns up to the requested number of next departures.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from | string | yes | Departure station name or ID. |
to | string | yes | Arrival station name or ID. |
limit | number | no | Maximum number of connections to return. Defaults to 4. |
Example call
Arguments
{
"from": "Zurich HB",
"to": "Geneva"
}
curl
curl -X POST https://gateway.pipeworx.io/swisstransport/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_connections","arguments":{"from":"Zurich HB","to":"Geneva"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_connections', {
"from": "Zurich HB",
"to": "Geneva"
});
More examples
{
"from": "Bern",
"to": "Lausanne",
"limit": 6
}
Response shape
Always returns: from, to, count, connections
| Field | Type | Description |
|---|---|---|
from | object | Departure station |
to | object | Arrival station |
count | number | Number of connections returned |
connections | array | List of available connections |
Full JSON Schema
{
"type": "object",
"properties": {
"from": {
"type": "object",
"description": "Departure station",
"properties": {
"id": {
"type": [
"string",
"null"
],
"description": "Station identifier"
},
"name": {
"type": [
"string",
"null"
],
"description": "Station name"
},
"coordinate": {
"type": [
"object",
"null"
],
"description": "Geographic coordinates",
"properties": {
"x": {
"type": [
"number",
"null"
],
"description": "X coordinate (longitude)"
},
"y": {
"type": [
"number",
"null"
],
"description": "Y coordinate (latitude)"
}
}
}
}
},
"to": {
"type": "object",
"description": "Arrival station",
"properties": {
"id": {
"type": [
"string",
"null"
],
"description": "Station identifier"
},
"name": {
"type": [
"string",
"null"
],
"description": "Station name"
},
"coordinate": {
"type": [
"object",
"null"
],
"description": "Geographic coordinates",
"properties": {
"x": {
"type": [
"number",
"null"
],
"description": "X coordinate (longitude)"
},
"y": {
"type": [
"number",
"null"
],
"description": "Y coordinate (latitude)"
}
}
}
}
},
"count": {
"type": "number",
"description": "Number of connections returned"
},
"connections": {
"type": "array",
"description": "List of available connections",
"items": {
"type": "object",
"properties": {
"duration": {
"type": "string",
"description": "Total journey duration"
},
"transfers": {
"type": "number",
"description": "Number of transfers required"
},
"departure": {
"type": "object",
"description": "Departure stop details",
"properties": {
"station": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
],
"description": "Station identifier"
},
"name": {
"type": [
"string",
"null"
],
"description": "Station name"
},
"coordinate": {
"type": [
"object",
"null"
],
"properties": {
"x": {
"type": [
"number",
"null"
]
},
"y": {
"type": [
"number",
"null"
]
}
}
}
}
},
"arrival": {
"type": [
"string",
"null"
],
"description": "Arrival time at this stop"
},
"departure": {
"type": [
"string",
"null"
],
"description": "Departure time from this stop"
},
"delay": {
"type": [
"number",
"null"
],
"description": "Delay in minutes"
},
"platform": {
"type": [
"string",
"null"
],
"description": "Platform number"
}
}
},
"arrival": {
"type": "object",
"description": "Arrival stop details",
"properties": {
"station": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
],
"description": "Station identifier"
},
"name": {
"type": [
"string",
"null"
],
"description": "Station name"
},
"coordinate": {
"type": [
"object",
"null"
],
"properties": {
"x": {
"type": [
"number",
"null"
]
},
"y": {
"type": [
"number",
"null"
]
}
}
}
}
},
"arrival": {
"type": [
"string",
"null"
],
"description": "Arrival time at this stop"
},
"departure": {
"type": [
"string",
"null"
],
"description": "Departure time from this stop"
},
"delay": {
"type": [
"number",
"null"
],
"description": "Delay in minutes"
},
"platform": {
"type": [
"string",
"null"
],
"description": "Platform number"
}
}
},
"sections": {
"type": "array",
"description": "Journey sections (vehicle legs or walks)",
"items": {
"type": "object",
"properties": {
"departure": {
"type": "object",
"description": "Section departure stop",
"properties": {
"station": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"coordinate": {
"type": [
"object",
"null"
],
"properties": {
"x": {
"type": [
"number",
"null"
]
},
"y": {
"type": [
"number",
"null"
]
}
}
}
}
},
"arrival": {
"type": [
"string",
"null"
]
},
"departure": {
"type": [
"string",
"null"
]
},
"delay": {
"type": [
"number",
"null"
]
},
"platform": {
"type": [
"string",
"null"
]
}
}
},
"arrival": {
"type": "object",
"description": "Section arrival stop",
"properties": {
"station": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"coordinate": {
"type": [
"object",
"null"
],
"properties": {
"x": {
"type": [
"number",
"null"
]
},
"y": {
"type": [
"number",
"null"
]
}
}
}
}
},
"arrival": {
"type": [
"string",
"null"
]
},
"departure": {
"type": [
"string",
"null"
]
},
"delay": {
"type": [
"number",
"null"
]
},
"platform": {
"type": [
"string",
"null"
]
}
}
},
"journey": {
"type": [
"object",
"null"
],
"description": "Public transport vehicle details",
"properties": {
"name": {
"type": "string",
"description": "Journey name"
},
"category": {
"type": "string",
"description": "Transport category (e.g., train, bus)"
},
"number": {
"type": "string",
"description": "Vehicle number"
},
"operator": {
"type": "string",
"description": "Transport operator name"
},
"to": {
"type": "string",
"description": "Vehicle destination"
}
}
},
"walk": {
"type": [
"object",
"null"
],
"description": "Walking segment details",
"properties": {
"duration": {
"type": "number",
"description": "Walking duration in seconds"
}
}
}
}
}
}
}
}
}
},
"required": [
"from",
"to",
"count",
"connections"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"swisstransport": {
"url": "https://gateway.pipeworx.io/swisstransport/mcp"
}
}
}
See Getting Started for client-specific install steps.