reunion_list_iris
List IRIS (sub-communal statistical zones) for a commune in La Réunion. Returns IRIS code, name, type, commune, EPCI, and grand-quartier details.
Instructions
List IRIS (Îlots Regroupés pour l'Information Statistique) — INSEE's fine sub-communal statistical geography (~2000 inhabitants per zone), used for census, income, poverty, employment data. Returns IRIS code (9 digits), name, IRIS type (H = habitat, A = activité, D = divers), commune name and code, EPCI name, grand-quartier code and name, year reference. Combine with reunion_iris_profile (commune module) for cross-dataset IRIS analysis or reunion_get_income_poverty_by_iris (economy module).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commune | No | Commune name prefix match | |
| limit | No | Max IRIS to return (1-500, default 100) |
Implementation Reference
- src/modules/geography.ts:190-213 (handler)The async handler function that executes the 'reunion_list_iris' tool logic. Queries the 'iris-millesime-france' dataset with optional commune name filter, maps results to IRIS fields (code, name, type, commune, EPCI, grand-quartier, year).
async ({ commune, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_IRIS, { where: buildWhere([commune ? `com_name LIKE ${quote(`${commune}%`)}` : undefined]), limit, }); return jsonResult({ total_iris: data.total_count, iris: data.results.map((row) => ({ code: pickString(row, ['iris_code']), name: pickString(row, ['iris_name']), type: pickString(row, ['iris_type']), commune_name: pickString(row, ['com_name']), commune_code: pickString(row, ['com_code']), epci_name: pickString(row, ['epci_name']), grand_quartier_code: pickString(row, ['iris_grd_quart_code']), grand_quartier_name: pickString(row, ['iris_grd_quart_name']), year: pickString(row, ['year']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to list IRIS'); } } - src/modules/geography.ts:186-189 (schema)Input schema for the tool: optional 'commune' string (prefix match) and 'limit' integer (1-500, default 100).
{ commune: z.string().optional().describe('Commune name prefix match'), limit: z.number().int().min(1).max(500).default(100).describe('Max IRIS to return (1-500, default 100)'), }, - src/modules/geography.ts:183-214 (registration)Registration of 'reunion_list_iris' as an MCP tool via server.tool(), with description, schema, and handler. Part of registerGeographyTools() which is called from src/modules/index.ts line 43.
server.tool( 'reunion_list_iris', 'List IRIS (Îlots Regroupés pour l\'Information Statistique) — INSEE\'s fine sub-communal statistical geography (~2000 inhabitants per zone), used for census, income, poverty, employment data. Returns IRIS code (9 digits), name, IRIS type (H = habitat, A = activité, D = divers), commune name and code, EPCI name, grand-quartier code and name, year reference. Combine with reunion_iris_profile (commune module) for cross-dataset IRIS analysis or reunion_get_income_poverty_by_iris (economy module).', { commune: z.string().optional().describe('Commune name prefix match'), limit: z.number().int().min(1).max(500).default(100).describe('Max IRIS to return (1-500, default 100)'), }, async ({ commune, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_IRIS, { where: buildWhere([commune ? `com_name LIKE ${quote(`${commune}%`)}` : undefined]), limit, }); return jsonResult({ total_iris: data.total_count, iris: data.results.map((row) => ({ code: pickString(row, ['iris_code']), name: pickString(row, ['iris_name']), type: pickString(row, ['iris_type']), commune_name: pickString(row, ['com_name']), commune_code: pickString(row, ['com_code']), epci_name: pickString(row, ['epci_name']), grand_quartier_code: pickString(row, ['iris_grd_quart_code']), grand_quartier_name: pickString(row, ['iris_grd_quart_name']), year: pickString(row, ['year']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to list IRIS'); } } ); - src/modules/geography.ts:7-7 (helper)Helper imports used by the tool: buildWhere, errorResult, jsonResult, pickString, quote from '../utils/helpers.js'.
import { buildWhere, errorResult, jsonResult, pickNumber, pickString, quote } from '../utils/helpers.js'; - src/modules/geography.ts:14-15 (registration)Dataset constant DATASET_IRIS = 'iris-millesime-france' used by the handler to query IRIS records.
const DATASET_IRIS = 'iris-millesime-france'; const DATASET_SAINT_DENIS_QUARTERS = 'les-20-quartiers-villesaintdenis';