reunion_get_college_ips
Retrieve Indice de Position Sociale (IPS) for middle schools in La Réunion. Filter by commune, sector, and school year to assess social mix and educational inequality.
Instructions
DEPP Indice de Position Sociale (IPS) of middle schools (collèges) in La Réunion. IPS is a 50-200 score that summarizes the average socio-professional category of pupils' parents (higher = more privileged students). It is the standard tool to assess school social mix and educational inequality. Returns school name, UAI ID, commune, sector (Public/Privé sous contrat), school year, IPS value, IPS standard deviation. Sorted IPS descending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commune | No | Commune name prefix match | |
| sector | No | School sector: "Public" (public) or "Privé sous contrat" (subsidized private) | |
| rentree | No | School year (rentrée), format YYYY-YYYY. Examples: "2021-2022", "2022-2023" | |
| limit | No | Max schools to return (1-500, default 100) |
Implementation Reference
- src/modules/education.ts:18-55 (registration)Registration of the 'reunion_get_college_ips' tool via server.tool() on the McpServer. The tool name and description are defined here.
export function registerEducationTools(server: McpServer): void { server.tool( 'reunion_get_college_ips', 'DEPP Indice de Position Sociale (IPS) of middle schools (collèges) in La Réunion. IPS is a 50-200 score that summarizes the average socio-professional category of pupils\' parents (higher = more privileged students). It is the standard tool to assess school social mix and educational inequality. Returns school name, UAI ID, commune, sector (Public/Privé sous contrat), school year, IPS value, IPS standard deviation. Sorted IPS descending.', { commune: z.string().optional().describe('Commune name prefix match'), sector: z.enum(['Public', 'Privé sous contrat']).optional().describe('School sector: "Public" (public) or "Privé sous contrat" (subsidized private)'), rentree: z.string().optional().describe('School year (rentrée), format YYYY-YYYY. Examples: "2021-2022", "2022-2023"'), limit: z.number().int().min(1).max(500).default(100).describe('Max schools to return (1-500, default 100)'), }, async ({ commune, sector, rentree, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_IPS_COLLEGES, { where: buildWhere([ commune ? `nom_de_la_commune LIKE ${quote(`${commune}%`)}` : undefined, sector ? `secteur = ${quote(sector)}` : undefined, rentree ? `rentree_scolaire = ${quote(rentree)}` : undefined, ]), order_by: 'ips DESC', limit, }); return jsonResult({ total_schools: data.total_count, schools: data.results.map((row) => ({ school: pickString(row, ['nom_de_l_etablissment']), uai: pickString(row, ['uai']), commune: pickString(row, ['nom_de_la_commune']), sector: pickString(row, ['secteur']), rentree: pickString(row, ['rentree_scolaire']), ips: pickNumber(row, ['ips']), ips_stddev: pickNumber(row, ['ecart_type_de_l_ips']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch college IPS'); } } ); - src/modules/education.ts:18-55 (handler)Handler function for the 'reunion_get_college_ips' tool. Queries the 'indices-de-position-sociale-dans-les-colleges-a-la-reunion' dataset via the client, filters by optional commune/sector/rentree parameters, orders by IPS descending, and returns school info (name, UAI, commune, sector, rentree, IPS, IPS stddev).
export function registerEducationTools(server: McpServer): void { server.tool( 'reunion_get_college_ips', 'DEPP Indice de Position Sociale (IPS) of middle schools (collèges) in La Réunion. IPS is a 50-200 score that summarizes the average socio-professional category of pupils\' parents (higher = more privileged students). It is the standard tool to assess school social mix and educational inequality. Returns school name, UAI ID, commune, sector (Public/Privé sous contrat), school year, IPS value, IPS standard deviation. Sorted IPS descending.', { commune: z.string().optional().describe('Commune name prefix match'), sector: z.enum(['Public', 'Privé sous contrat']).optional().describe('School sector: "Public" (public) or "Privé sous contrat" (subsidized private)'), rentree: z.string().optional().describe('School year (rentrée), format YYYY-YYYY. Examples: "2021-2022", "2022-2023"'), limit: z.number().int().min(1).max(500).default(100).describe('Max schools to return (1-500, default 100)'), }, async ({ commune, sector, rentree, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_IPS_COLLEGES, { where: buildWhere([ commune ? `nom_de_la_commune LIKE ${quote(`${commune}%`)}` : undefined, sector ? `secteur = ${quote(sector)}` : undefined, rentree ? `rentree_scolaire = ${quote(rentree)}` : undefined, ]), order_by: 'ips DESC', limit, }); return jsonResult({ total_schools: data.total_count, schools: data.results.map((row) => ({ school: pickString(row, ['nom_de_l_etablissment']), uai: pickString(row, ['uai']), commune: pickString(row, ['nom_de_la_commune']), sector: pickString(row, ['secteur']), rentree: pickString(row, ['rentree_scolaire']), ips: pickNumber(row, ['ips']), ips_stddev: pickNumber(row, ['ecart_type_de_l_ips']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch college IPS'); } } ); - src/modules/education.ts:22-27 (schema)Input schema for the tool using Zod: commune (optional string), sector (optional enum 'Public'/'Privé sous contrat'), rentree (optional string), limit (int 1-500, default 100).
{ commune: z.string().optional().describe('Commune name prefix match'), sector: z.enum(['Public', 'Privé sous contrat']).optional().describe('School sector: "Public" (public) or "Privé sous contrat" (subsidized private)'), rentree: z.string().optional().describe('School year (rentrée), format YYYY-YYYY. Examples: "2021-2022", "2022-2023"'), limit: z.number().int().min(1).max(500).default(100).describe('Max schools to return (1-500, default 100)'), }, - src/modules/education.ts:9-9 (helper)Dataset constant DATASET_IPS_COLLEGES = 'indices-de-position-sociale-dans-les-colleges-a-la-reunion' used by the handler to query the correct data source.
const DATASET_IPS_COLLEGES = 'indices-de-position-sociale-dans-les-colleges-a-la-reunion'; - src/modules/index.ts:10-10 (registration)Import of registerEducationTools from education.ts into the central module registration file.
import { registerEducationTools } from './education.js';