reunion_search_sport_facilities
Search sport facilities in La Réunion including stadiums, gyms, swimming pools, tennis courts, and more. Returns equipment details, address, commune, and accessibility info from the national registry.
Instructions
Search the national sport-equipment registry (Recensement des Équipements Sportifs, RES) restricted to La Réunion. Covers all sport infrastructure: stadiums, gyms, swimming pools, tennis courts, boules courts, athletic tracks, climbing walls, skate parks, dojos, etc. Each row is one equipment within an installation. Returns installation and equipment names, type, family, address, postal code, commune, reduced-mobility accessibility, parking spaces. Source: Ministère des Sports via data.regionreunion.com.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Sport-equipment type prefix match. Examples: "Court de tennis", "Terrain de football", "Salle multisports", "Piste d'athlétisme", "Mur d'escalade" | |
| family | No | Equipment family prefix match. Examples: "Petits terrains en accès libre", "Terrains de grands jeux", "Salles spécialisées", "Bassins de natation" | |
| commune | No | Commune name prefix match | |
| limit | No | Max facilities to return (1-500, default 50) |
Implementation Reference
- src/modules/facilities.ts:89-127 (handler)The tool handler for 'reunion_search_sport_facilities'. Calls the ReunionClient.getRecords method on the 'equipements-sportifs' dataset with optional filters (type, family, commune) and returns a JSON result with installation name, equipment name, type, family, address, postal code, commune, accessibility, and parking spaces.
server.tool( 'reunion_search_sport_facilities', 'Search the national sport-equipment registry (Recensement des Équipements Sportifs, RES) restricted to La Réunion. Covers all sport infrastructure: stadiums, gyms, swimming pools, tennis courts, boules courts, athletic tracks, climbing walls, skate parks, dojos, etc. Each row is one equipment within an installation. Returns installation and equipment names, type, family, address, postal code, commune, reduced-mobility accessibility, parking spaces. Source: Ministère des Sports via data.regionreunion.com.', { type: z.string().optional().describe('Sport-equipment type prefix match. Examples: "Court de tennis", "Terrain de football", "Salle multisports", "Piste d\'athlétisme", "Mur d\'escalade"'), family: z.string().optional().describe('Equipment family prefix match. Examples: "Petits terrains en accès libre", "Terrains de grands jeux", "Salles spécialisées", "Bassins de natation"'), commune: z.string().optional().describe('Commune name prefix match'), limit: z.number().int().min(1).max(500).default(50).describe('Max facilities to return (1-500, default 50)'), }, async ({ type, family, commune, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_SPORT, { where: buildWhere([ type ? `type_d_equipement_sportif LIKE ${quote(`${type}%`)}` : undefined, family ? `famille_d_equipement_sportif LIKE ${quote(`${family}%`)}` : undefined, commune ? `commune LIKE ${quote(`${commune}%`)}` : undefined, ]), limit, }); return jsonResult({ total_facilities: data.total_count, facilities: data.results.map((row) => ({ installation_name: pickString(row, ['nom_de_l_installation_sportive']), equipment_name: pickString(row, ['nom_de_l_equipement_sportif']), type: pickString(row, ['type_d_equipement_sportif']), family: pickString(row, ['famille_d_equipement_sportif']), address: pickString(row, ['numero_type_et_nom_de_la_voie']), postal_code: pickString(row, ['code_postal']), commune: pickString(row, ['commune']), accessible: pickString(row, ['accessibilite_de_l_installation_en_faveur_des_personnes_en_situation_de_handicap']), parking_spaces: pickNumber(row, ['nombre_de_places_de_parking_reservees_a_l_installation']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search sport facilities'); } } ); - src/modules/facilities.ts:92-97 (schema)Zod schema for the tool's input parameters: type (string, optional), family (string, optional), commune (string, optional), limit (integer 1-500, default 50).
{ type: z.string().optional().describe('Sport-equipment type prefix match. Examples: "Court de tennis", "Terrain de football", "Salle multisports", "Piste d\'athlétisme", "Mur d\'escalade"'), family: z.string().optional().describe('Equipment family prefix match. Examples: "Petits terrains en accès libre", "Terrains de grands jeux", "Salles spécialisées", "Bassins de natation"'), commune: z.string().optional().describe('Commune name prefix match'), limit: z.number().int().min(1).max(500).default(50).describe('Max facilities to return (1-500, default 50)'), }, - src/modules/facilities.ts:89-128 (registration)The tool is registered via server.tool() with name 'reunion_search_sport_facilities' inside the registerFacilityTools function in src/modules/facilities.ts.
server.tool( 'reunion_search_sport_facilities', 'Search the national sport-equipment registry (Recensement des Équipements Sportifs, RES) restricted to La Réunion. Covers all sport infrastructure: stadiums, gyms, swimming pools, tennis courts, boules courts, athletic tracks, climbing walls, skate parks, dojos, etc. Each row is one equipment within an installation. Returns installation and equipment names, type, family, address, postal code, commune, reduced-mobility accessibility, parking spaces. Source: Ministère des Sports via data.regionreunion.com.', { type: z.string().optional().describe('Sport-equipment type prefix match. Examples: "Court de tennis", "Terrain de football", "Salle multisports", "Piste d\'athlétisme", "Mur d\'escalade"'), family: z.string().optional().describe('Equipment family prefix match. Examples: "Petits terrains en accès libre", "Terrains de grands jeux", "Salles spécialisées", "Bassins de natation"'), commune: z.string().optional().describe('Commune name prefix match'), limit: z.number().int().min(1).max(500).default(50).describe('Max facilities to return (1-500, default 50)'), }, async ({ type, family, commune, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_SPORT, { where: buildWhere([ type ? `type_d_equipement_sportif LIKE ${quote(`${type}%`)}` : undefined, family ? `famille_d_equipement_sportif LIKE ${quote(`${family}%`)}` : undefined, commune ? `commune LIKE ${quote(`${commune}%`)}` : undefined, ]), limit, }); return jsonResult({ total_facilities: data.total_count, facilities: data.results.map((row) => ({ installation_name: pickString(row, ['nom_de_l_installation_sportive']), equipment_name: pickString(row, ['nom_de_l_equipement_sportif']), type: pickString(row, ['type_d_equipement_sportif']), family: pickString(row, ['famille_d_equipement_sportif']), address: pickString(row, ['numero_type_et_nom_de_la_voie']), postal_code: pickString(row, ['code_postal']), commune: pickString(row, ['commune']), accessible: pickString(row, ['accessibilite_de_l_installation_en_faveur_des_personnes_en_situation_de_handicap']), parking_spaces: pickNumber(row, ['nombre_de_places_de_parking_reservees_a_l_installation']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search sport facilities'); } } ); } - src/modules/index.ts:42-42 (registration)registerFacilityTools is called from src/modules/index.ts -> registerAllTools, which is invoked from src/index.ts (line 22).
registerFacilityTools(server); - src/utils/helpers.ts:36-41 (helper)buildWhere helper combines filter conditions with AND; quote helper for ODSQL string escaping.
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; }