reunion_list_coworking_spaces
Retrieve coworking spaces and shared offices in La Réunion by commune. Returns contact details and location for remote work.
Instructions
List coworking spaces and shared offices in La Réunion (tiers-lieux numériques, espaces partagés, fab labs sometimes). Returns name, type, website, coarse location (zone), full address, email, phone, dataset page URL. Useful for remote workers, freelancers, business travelers needing flexible workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commune | No | Coarse-location prefix match (typically a region or commune name like "Saint-Denis", "Saint-Pierre", "Le Tampon") | |
| limit | No | Max spaces to return (1-100, default 50) |
Implementation Reference
- src/modules/economy.ts:1-14 (helper)Imports and constants used by the tool, including the DATASET_COWORKING dataset identifier 'espace-de-coworkings-sur-l-ile-de-la-reunion' and helper utilities like client, buildWhere, jsonResult, errorResult, pickString, quote.
// src/modules/economy.ts import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; import { client } from '../client.js'; import { RecordObject } from '../types.js'; import { buildWhere, errorResult, jsonResult, pickNumber, pickString, quote } from '../utils/helpers.js'; const DATASET_SIRENE = 'base-sirene-v3-lareunion'; const DATASET_CPI = 'insee-indices-des-prix-a-la-consommation-a-la-reunion-valeurs-mensuelles'; const DATASET_FEDER = 'liste_des_operations_31'; const DATASET_COWORKING = 'espace-de-coworkings-sur-l-ile-de-la-reunion'; const DATASET_INCOME_IRIS = 'revenus-declares-pauvrete-et-niveau-de-vie-en-2015-irispublic'; - src/modules/economy.ts:15-15 (registration)The function signature registerEconomyTools(server: McpServer) that registers all economy tools, including reunion_list_coworking_spaces.
export function registerEconomyTools(server: McpServer): void { - src/modules/economy.ts:150-180 (handler)The exact tool handler implementation for 'reunion_list_coworking_spaces'. It accepts optional 'commune' (coarse location prefix filter) and 'limit' (1-100, default 50) parameters. Calls client.getRecords on the DATASET_COWORKING dataset with an ODSQL WHERE clause filtering by coarse_location, then maps results to return name, type, website, coarse_location, address, email, phone, and page_url.
server.tool( 'reunion_list_coworking_spaces', 'List coworking spaces and shared offices in La Réunion (tiers-lieux numériques, espaces partagés, fab labs sometimes). Returns name, type, website, coarse location (zone), full address, email, phone, dataset page URL. Useful for remote workers, freelancers, business travelers needing flexible workspace.', { commune: z.string().optional().describe('Coarse-location prefix match (typically a region or commune name like "Saint-Denis", "Saint-Pierre", "Le Tampon")'), limit: z.number().int().min(1).max(100).default(50).describe('Max spaces to return (1-100, default 50)'), }, async ({ commune, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_COWORKING, { where: buildWhere([commune ? `coarse_location LIKE ${quote(`${commune}%`)}` : undefined]), limit, }); return jsonResult({ total_spaces: data.total_count, spaces: data.results.map((row) => ({ name: pickString(row, ['name']), type: pickString(row, ['type']), website: pickString(row, ['website']), coarse_location: pickString(row, ['coarse_location']), address: pickString(row, ['address']), email: pickString(row, ['email']), phone: pickString(row, ['phone']), page_url: pickString(row, ['page_url']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to list coworking spaces'); } } ); - src/modules/economy.ts:153-156 (schema)Zod schema for the tool's input parameters: commune (optional string, coarse-location prefix match) and limit (optional integer 1-100, default 50).
{ commune: z.string().optional().describe('Coarse-location prefix match (typically a region or commune name like "Saint-Denis", "Saint-Pierre", "Le Tampon")'), limit: z.number().int().min(1).max(100).default(50).describe('Max spaces to return (1-100, default 50)'), }, - src/client.ts:33-61 (helper)The ReunionClient class with getRecords method used by the handler to fetch coworking space data from the OpenDataSoft API at data.regionreunion.com.
export class ReunionClient { private readonly baseUrl = 'https://data.regionreunion.com/api/explore/v2.1/'; private readonly timeout = 30000; private readonly maxRetries = 2; private readonly metadataCache = new Map<string, Promise<DatasetMetadata | undefined>>(); private readonly recordsCache = new Map<string, { value: unknown; expiresAt: number }>(); /** * Fetch records from a dataset */ async getRecords<T extends RecordObject = RecordObject>( datasetId: string, params: ODSQueryParams = {} ): Promise<ODSResponse<T>> { const url = this.buildUrl(`/catalog/datasets/${datasetId}/records`, params); if (REFERENTIAL_DATASETS.has(datasetId)) { const now = Date.now(); const cached = this.recordsCache.get(url); if (cached && cached.expiresAt > now) { return cached.value as ODSResponse<T>; } const value = await this.fetchJson<ODSResponse<T>>(url); this.recordsCache.set(url, { value, expiresAt: now + REFERENTIAL_TTL_MS }); return value; } return this.fetchJson<ODSResponse<T>>(url); }