reunion_get_museum_attendance
Retrieve annual attendance figures for Musée de France in La Réunion, broken down by paid and free admissions, to support cultural policy evaluation and tourism analysis.
Instructions
Annual attendance figures for each Musée de France in La Réunion, broken down by paid vs free admissions. Returns year, museum name, Muséofile reference, city, paid visitors, free visitors, total visitors, notes, observations. Source: Ministère de la Culture / Patrimostat via data.regionreunion.com. Sorted by year descending. Useful for cultural-policy evaluation, tourism analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Year filter (4 digits, e.g. 2022) | |
| museum | No | Museum name prefix match (e.g. "Léon Dierx", "Stella Matutina") | |
| limit | No | Max rows to return (1-500, default 100) |
Implementation Reference
- src/modules/culture.ts:165-201 (handler)The handler function for 'reunion_get_museum_attendance' tool. Fetches annual attendance figures for Musée de France in La Réunion from the 'frequentation-des-musees-de-franceculture' dataset, with optional filters for year and museum name, sorted by year descending.
server.tool( 'reunion_get_museum_attendance', 'Annual attendance figures for each Musée de France in La Réunion, broken down by paid vs free admissions. Returns year, museum name, Muséofile reference, city, paid visitors, free visitors, total visitors, notes, observations. Source: Ministère de la Culture / Patrimostat via data.regionreunion.com. Sorted by year descending. Useful for cultural-policy evaluation, tourism analysis.', { year: z.number().int().optional().describe('Year filter (4 digits, e.g. 2022)'), museum: z.string().optional().describe('Museum name prefix match (e.g. "Léon Dierx", "Stella Matutina")'), limit: z.number().int().min(1).max(500).default(100).describe('Max rows to return (1-500, default 100)'), }, async ({ year, museum, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_MUSEUM_ATTENDANCE, { where: buildWhere([ year !== undefined ? `annee = ${year}` : undefined, museum ? `nom_du_musee LIKE ${quote(`${museum}%`)}` : undefined, ]), order_by: 'annee DESC', limit, }); return jsonResult({ total_rows: data.total_count, attendance: data.results.map((row) => ({ year: pickNumber(row, ['annee']), museum: pickString(row, ['nom_du_musee']), museofile_ref: pickString(row, ['ref_musee']), city: pickString(row, ['ville']), paid_visitors: pickNumber(row, ['payant']), free_visitors: pickNumber(row, ['gratuit']), total_visitors: pickNumber(row, ['total']), note: pickString(row, ['note']), observations: pickString(row, ['observations']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch museum attendance'); } } ); - src/modules/culture.ts:168-172 (schema)Input schema for the tool: year (optional int), museum (optional string prefix), limit (int 1-500, default 100).
{ year: z.number().int().optional().describe('Year filter (4 digits, e.g. 2022)'), museum: z.string().optional().describe('Museum name prefix match (e.g. "Léon Dierx", "Stella Matutina")'), limit: z.number().int().min(1).max(500).default(100).describe('Max rows to return (1-500, default 100)'), }, - src/modules/culture.ts:184-196 (schema)Output schema: returns total_rows and an attendance array with year, museum, museofile_ref, city, paid_visitors, free_visitors, total_visitors, note, and observations.
total_rows: data.total_count, attendance: data.results.map((row) => ({ year: pickNumber(row, ['annee']), museum: pickString(row, ['nom_du_musee']), museofile_ref: pickString(row, ['ref_musee']), city: pickString(row, ['ville']), paid_visitors: pickNumber(row, ['payant']), free_visitors: pickNumber(row, ['gratuit']), total_visitors: pickNumber(row, ['total']), note: pickString(row, ['note']), observations: pickString(row, ['observations']), })), }); - src/modules/culture.ts:165-201 (registration)Registration of the tool via server.tool() call within registerCultureTools, which is called from src/modules/index.ts line 37.
server.tool( 'reunion_get_museum_attendance', 'Annual attendance figures for each Musée de France in La Réunion, broken down by paid vs free admissions. Returns year, museum name, Muséofile reference, city, paid visitors, free visitors, total visitors, notes, observations. Source: Ministère de la Culture / Patrimostat via data.regionreunion.com. Sorted by year descending. Useful for cultural-policy evaluation, tourism analysis.', { year: z.number().int().optional().describe('Year filter (4 digits, e.g. 2022)'), museum: z.string().optional().describe('Museum name prefix match (e.g. "Léon Dierx", "Stella Matutina")'), limit: z.number().int().min(1).max(500).default(100).describe('Max rows to return (1-500, default 100)'), }, async ({ year, museum, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_MUSEUM_ATTENDANCE, { where: buildWhere([ year !== undefined ? `annee = ${year}` : undefined, museum ? `nom_du_musee LIKE ${quote(`${museum}%`)}` : undefined, ]), order_by: 'annee DESC', limit, }); return jsonResult({ total_rows: data.total_count, attendance: data.results.map((row) => ({ year: pickNumber(row, ['annee']), museum: pickString(row, ['nom_du_musee']), museofile_ref: pickString(row, ['ref_musee']), city: pickString(row, ['ville']), paid_visitors: pickNumber(row, ['payant']), free_visitors: pickNumber(row, ['gratuit']), total_visitors: pickNumber(row, ['total']), note: pickString(row, ['note']), observations: pickString(row, ['observations']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch museum attendance'); } } ); - src/modules/index.ts:37-37 (registration)Registration entry point: registerCultureTools(server) invoked from registerAllTools, which wires up all tools to the MCP server.
registerCultureTools(server); - src/modules/culture.ts:13-13 (helper)The dataset constant 'frequentation-des-musees-de-franceculture' used by the tool to query attendance data.
const DATASET_MUSEUM_ATTENDANCE = 'frequentation-des-musees-de-franceculture';