initialize_data
Manually trigger GTFS data initialization for the CATA Bus MCP Server to enable real-time bus tracking, arrival predictions, and route information.
Instructions
Manually trigger GTFS data initialization.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "initialize_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/catabus_mcp/server.py:202-211 (handler)The handler function for the 'initialize_data' tool. It is registered via the @mcp.tool decorator. Calls ensure_initialized() to load GTFS static and realtime data if not already done, then returns a status dictionary with loaded data counts.
@mcp.tool async def initialize_data() -> dict[str, Any]: """Manually trigger GTFS data initialization.""" await ensure_initialized() return { "status": "initialized" if initialized else "failed", "routes_loaded": len(gtfs_data.routes) if gtfs_data else 0, "stops_loaded": len(gtfs_data.stops) if gtfs_data else 0, "message": "GTFS data has been loaded" if initialized else "Failed to load GTFS data", }