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.
Input Schema
TableJSON 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", }