run_sql_query
Run read-only SQL SELECT queries on GTFS data (routes, stops, trips, stop_times, calendar) to answer custom questions beyond standard tools.
Instructions
Run a read-only SQL SELECT query against the GTFS database directly, for questions the other tools don't cover.
Only SELECT statements are permitted. Available tables: routes, stops, trips, stop_times, calendar (each has a gtfs_mode column identifying the transport mode). Use the ptv://schema resource to see column details.
Args: query: A single SQL SELECT statement.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "run_sql_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |