reunion_search_car_jaune_stops
Search bus stops of La Réunion's Car Jaune interurban bus network by name, code, or wheelchair accessibility. Returns stop details including coordinates and accessibility flags.
Instructions
Search bus stops of the Car Jaune network — La Réunion's interurban bus service operated by the Région — using GTFS data. Returns stop_id, stop_code, name, description, zone_id, location_type, parent_station, wheelchair-boarding flag, geographic coordinates. Use reunion_list_car_jaune_routes to list bus lines. Source: GTFS feed via data.regionreunion.com.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Free-text search on stop name (e.g. "Saint-Denis", "Aéroport", "Gare") | |
| stop_code | No | Exact stop code as displayed at the stop | |
| wheelchair_accessible | No | If true, return only stops flagged wheelchair-accessible (GTFS wheelchair_boarding = "1") | |
| limit | No | Max stops to return (1-500, default 50) |
Implementation Reference
- src/modules/transport.ts:98-135 (handler)The tool handler for 'reunion_search_car_jaune_stops'. It defines the tool with an MCP server.tool() call, accepts query/stop_code/wheelchair_accessible/limit parameters validated via Zod, queries the OpenDataSoft GTFS dataset (DATASET_GTFS = 'donnees-gtfs-lareunion'), builds an ODSQL WHERE clause, and returns stop records with stop_id, stop_code, stop_name, stop_desc, zone_id, location_type, parent_station, wheelchair_boarding, and stop_coordinates.
server.tool( 'reunion_search_car_jaune_stops', 'Search bus stops of the Car Jaune network — La Réunion\'s interurban bus service operated by the Région — using GTFS data. Returns stop_id, stop_code, name, description, zone_id, location_type, parent_station, wheelchair-boarding flag, geographic coordinates. Use reunion_list_car_jaune_routes to list bus lines. Source: GTFS feed via data.regionreunion.com.', { query: z.string().optional().describe('Free-text search on stop name (e.g. "Saint-Denis", "Aéroport", "Gare")'), stop_code: z.string().optional().describe('Exact stop code as displayed at the stop'), wheelchair_accessible: z.boolean().optional().describe('If true, return only stops flagged wheelchair-accessible (GTFS wheelchair_boarding = "1")'), limit: z.number().int().min(1).max(500).default(50).describe('Max stops to return (1-500, default 50)'), }, async ({ query, stop_code, wheelchair_accessible, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_GTFS, { where: buildWhere([ query ? `search(${quote(query)})` : undefined, stop_code ? `stop_code = ${quote(stop_code)}` : undefined, wheelchair_accessible ? `wheelchair_boarding = ${quote('1')}` : undefined, ]), limit, }); return jsonResult({ total_stops: data.total_count, stops: data.results.map((row) => ({ stop_id: pickString(row, ['stop_id']), stop_code: pickString(row, ['stop_code']), stop_name: pickString(row, ['stop_name']), stop_desc: pickString(row, ['stop_desc']), zone_id: pickString(row, ['zone_id']), location_type: pickString(row, ['location_type']), parent_station: pickString(row, ['parent_station']), wheelchair_boarding: pickString(row, ['wheelchair_boarding']), stop_coordinates: row.stop_coordinates, })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch Car Jaune stops'); } } ); - src/modules/transport.ts:101-106 (schema)Zod schema for input validation: 'query' (optional string), 'stop_code' (optional string), 'wheelchair_accessible' (optional boolean), 'limit' (integer 1-500, default 50).
{ query: z.string().optional().describe('Free-text search on stop name (e.g. "Saint-Denis", "Aéroport", "Gare")'), stop_code: z.string().optional().describe('Exact stop code as displayed at the stop'), wheelchair_accessible: z.boolean().optional().describe('If true, return only stops flagged wheelchair-accessible (GTFS wheelchair_boarding = "1")'), limit: z.number().int().min(1).max(500).default(50).describe('Max stops to return (1-500, default 50)'), }, - src/utils/helpers.ts:36-41 (helper)buildWhere helper constructs ODSQL WHERE clauses from conditions, used by the tool handler to filter stops by query, stop_code, and wheelchair_accessible.
export function buildWhere( conditions: Array<string | undefined | null | false> ): string | undefined { const valid = conditions.filter((condition): condition is string => Boolean(condition)); return valid.length > 0 ? valid.join(' AND ') : undefined; } - src/utils/helpers.ts:108-120 (helper)pickString helper extracts string values from API records, used to map raw API fields to output fields.
export function pickString( record: RecordObject, candidates: string[] ): string | undefined { const value = pickValue(record, candidates); if (typeof value === 'string') { return value; } if (typeof value === 'number' || typeof value === 'boolean') { return String(value); } return undefined; } - src/modules/index.ts:33-56 (registration)registerAllTools() calls registerTransportTools(server) on line 53, which registers the 'reunion_search_car_jaune_stops' tool.
export function registerAllTools(server: McpServer): void { registerAdministrationTools(server); registerCatalogTools(server); registerCommuneTools(server); registerCultureTools(server); registerEconomyTools(server); registerEducationTools(server); registerEmploymentTools(server); registerEnvironmentTools(server); registerFacilityTools(server); registerGeographyTools(server); registerHealthTools(server); registerHospitalityTools(server); registerHousingTools(server); registerNationalElectionsTools(server); registerPossessionTools(server); registerSocialTools(server); registerTelecomTools(server); registerTerritoryTools(server); registerTourismTools(server); registerTransportTools(server); registerUrbanismTools(server); registerWeatherTools(server); }