reunion_search_feder_beneficiaries
Search European Regional Development Fund beneficiaries in La Réunion by keyword, commune, or category. Returns operation details including funding amounts and location for transparency and regional analysis.
Instructions
Search beneficiaries of the European Regional Development Fund (FEDER / ERDF) 2014-2020 programming period in La Réunion. Returns funded operations: beneficiary name, operation title and summary, start/end dates, total eligible expenditure (EUR), EU contribution (EUR), location (postal code, city), intervention category (e.g. R&D, infrastructure, SMEs, environment). Sorted by start date descending. Useful to map EU-funded projects, audit transparency, or analyze regional development patterns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Free-text search across beneficiary name, operation title, summary | |
| commune | No | City/commune name prefix match | |
| category | No | Intervention category prefix match. Examples: "Recherche et innovation", "PME", "Économie à faibles émissions", "Infrastructures de transport" | |
| limit | No | Max operations to return (1-200, default 50) |
Implementation Reference
- src/modules/economy.ts:118-147 (handler)The async handler function that executes the 'reunion_search_feder_beneficiaries' tool logic. It queries the FEDER dataset via client.getRecords, builds a WHERE clause from optional filters (query/commune/category), orders by start date descending, limits results, and maps fields (beneficiary, operation, summary, dates, expenditure, EU contribution, location, intervention category). Returns total_operations and operations array, or an error.
async ({ query, commune, category, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_FEDER, { where: buildWhere([ query ? `search(${quote(query)})` : undefined, commune ? `ville LIKE ${quote(`${commune}%`)}` : undefined, category ? `categorie_d_intervention_category_of_intervention LIKE ${quote(`${category}%`)}` : undefined, ]), order_by: 'date_de_debut_de_l_operation_start_date DESC', limit, }); return jsonResult({ total_operations: data.total_count, operations: data.results.map((row) => ({ beneficiary: pickString(row, ['nom_du_beneficiaire_beneficiary']), operation: pickString(row, ['nom_de_l_operation_operation']), summary: pickString(row, ['resume_de_l_operation_summary']), start_date: pickString(row, ['date_de_debut_de_l_operation_start_date']), end_date: pickString(row, ['date_de_fin_de_l_operation_end_date']), total_eligible_eur: pickNumber(row, ['total_des_depenses_eligibles_total_eligible_expenditure']), eu_share_eur: pickNumber(row, ['ue']), postal_code: pickString(row, ['cp']), city: pickString(row, ['ville']), intervention_category: pickString(row, ['categorie_d_intervention_category_of_intervention']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search FEDER'); } } - src/modules/economy.ts:112-117 (schema)Zod schema defining the input parameters: query (optional string), commune (optional string), category (optional string with examples), and limit (optional integer 1-200 default 50).
{ query: z.string().optional().describe('Free-text search across beneficiary name, operation title, summary'), commune: z.string().optional().describe('City/commune name prefix match'), category: z.string().optional().describe('Intervention category prefix match. Examples: "Recherche et innovation", "PME", "Économie à faibles émissions", "Infrastructures de transport"'), limit: z.number().int().min(1).max(200).default(50).describe('Max operations to return (1-200, default 50)'), }, - src/modules/economy.ts:109-148 (registration)Registration of the tool via server.tool() call with name 'reunion_search_feder_beneficiaries', description, schema, and handler, within the registerEconomyTools function.
server.tool( 'reunion_search_feder_beneficiaries', 'Search beneficiaries of the European Regional Development Fund (FEDER / ERDF) 2014-2020 programming period in La Réunion. Returns funded operations: beneficiary name, operation title and summary, start/end dates, total eligible expenditure (EUR), EU contribution (EUR), location (postal code, city), intervention category (e.g. R&D, infrastructure, SMEs, environment). Sorted by start date descending. Useful to map EU-funded projects, audit transparency, or analyze regional development patterns.', { query: z.string().optional().describe('Free-text search across beneficiary name, operation title, summary'), commune: z.string().optional().describe('City/commune name prefix match'), category: z.string().optional().describe('Intervention category prefix match. Examples: "Recherche et innovation", "PME", "Économie à faibles émissions", "Infrastructures de transport"'), limit: z.number().int().min(1).max(200).default(50).describe('Max operations to return (1-200, default 50)'), }, async ({ query, commune, category, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_FEDER, { where: buildWhere([ query ? `search(${quote(query)})` : undefined, commune ? `ville LIKE ${quote(`${commune}%`)}` : undefined, category ? `categorie_d_intervention_category_of_intervention LIKE ${quote(`${category}%`)}` : undefined, ]), order_by: 'date_de_debut_de_l_operation_start_date DESC', limit, }); return jsonResult({ total_operations: data.total_count, operations: data.results.map((row) => ({ beneficiary: pickString(row, ['nom_du_beneficiaire_beneficiary']), operation: pickString(row, ['nom_de_l_operation_operation']), summary: pickString(row, ['resume_de_l_operation_summary']), start_date: pickString(row, ['date_de_debut_de_l_operation_start_date']), end_date: pickString(row, ['date_de_fin_de_l_operation_end_date']), total_eligible_eur: pickNumber(row, ['total_des_depenses_eligibles_total_eligible_expenditure']), eu_share_eur: pickNumber(row, ['ue']), postal_code: pickString(row, ['cp']), city: pickString(row, ['ville']), intervention_category: pickString(row, ['categorie_d_intervention_category_of_intervention']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search FEDER'); } } ); - src/modules/economy.ts:11-11 (helper)Dataset constant DATASET_FEDER = 'liste_des_operations_31' pointing to the OpenDataSoft dataset for FEDER beneficiaries.
const DATASET_FEDER = 'liste_des_operations_31'; - src/utils/helpers.ts:7-36 (helper)The buildWhere, jsonResult, errorResult, pickNumber, pickString, and quote helper functions imported by the handler from src/utils/helpers.ts.
*/ export function jsonResult(data: unknown): ToolResult { return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; } /** * Format error as tool result */ export function errorResult(message: string): ToolResult { return { content: [ { type: 'text', text: JSON.stringify({ error: message }, null, 2), }, ], }; } /** * Build ODSQL WHERE clause from conditions */ export function buildWhere(