reunion_search_sirene_establishments
Search the SIRENE national business registry for establishments located in La Réunion. Find SIRET, legal name, address, activity code, and administrative status.
Instructions
Search the SIRENE v3 national business registry, restricted to establishments located in La Réunion. Each establishment has a 14-digit SIRET (= 9-digit SIREN of the legal entity + 5-digit NIC). Returns SIREN/SIRET, denomination, usual name, brand, head-office flag, administrative state (active/closed), creation date, NAF activity code, workforce bracket, full address, postal code, commune, legal form, ESS (économie sociale et solidaire) status. Source: INSEE Sirene via data.regionreunion.com.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Free-text search across denomination, usual name, brand, address, activity | |
| siren | No | Exact 9-digit SIREN of the legal entity (unité légale) | |
| siret | No | Exact 14-digit SIRET of the establishment | |
| commune | No | Commune name prefix match (e.g. "Saint-Denis") | |
| naf | No | NAF/APE activity code prefix match. Examples: "47" for retail, "47.11" for hypermarkets, "56.10A" for traditional restaurants, "62" for IT | |
| limit | No | Max establishments to return (1-100, default 25) |
Implementation Reference
- src/modules/economy.ts:27-63 (handler)The async handler function that executes the tool logic: builds ODSQL where clause from optional filters (query, siren, siret, commune, naf, limit), calls client.getRecords on the 'base-sirene-v3-lareunion' dataset, and maps results to a structured response with establishment fields (SIREN, SIRET, denomination, usual_name, brand, head_office flag, state, creation_date, activity_code, workforce_bracket, address, postal_code, commune, legal_form, ESS status).
async ({ query, siren, siret, commune, naf, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_SIRENE, { where: buildWhere([ query ? `search(${quote(query)})` : undefined, siren ? `siren = ${quote(siren)}` : undefined, siret ? `siret = ${quote(siret)}` : undefined, commune ? `libellecommuneetablissement LIKE ${quote(`${commune}%`)}` : undefined, naf ? `activiteprincipaleetablissement LIKE ${quote(`${naf}%`)}` : undefined, ]), limit, }); return jsonResult({ total_establishments: data.total_count, establishments: data.results.map((row) => ({ siren: pickString(row, ['siren']), siret: pickString(row, ['siret']), denomination: pickString(row, ['denominationunitelegale']), usual_name: pickString(row, ['denominationusuelleetablissement']), brand: pickString(row, ['enseigne1etablissement']), is_head_office: pickString(row, ['etablissementsiege']), state: pickString(row, ['etatadministratifetablissement']), creation_date: pickString(row, ['datecreationetablissement']), activity_code: pickString(row, ['activiteprincipaleetablissement']), workforce_bracket: pickString(row, ['trancheeffectifsetablissement']), workforce_year: pickString(row, ['anneeeffectifsetablissement']), address: pickString(row, ['adresseetablissement']), postal_code: pickString(row, ['codepostaletablissement']), commune: pickString(row, ['libellecommuneetablissement']), legal_form: pickString(row, ['categoriejuridiqueunitelegale']), ess: pickString(row, ['economiesocialesolidaireunitelegale']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search SIRENE'); } } - src/modules/economy.ts:19-26 (schema)Zod schema definitions for input validation: query (optional string), siren (optional 9-digit string), siret (optional 14-digit string), commune (optional string), naf (optional string), limit (optional int 1-100, default 25).
{ query: z.string().optional().describe('Free-text search across denomination, usual name, brand, address, activity'), siren: z.string().optional().describe('Exact 9-digit SIREN of the legal entity (unité légale)'), siret: z.string().optional().describe('Exact 14-digit SIRET of the establishment'), commune: z.string().optional().describe('Commune name prefix match (e.g. "Saint-Denis")'), naf: z.string().optional().describe('NAF/APE activity code prefix match. Examples: "47" for retail, "47.11" for hypermarkets, "56.10A" for traditional restaurants, "62" for IT'), limit: z.number().int().min(1).max(100).default(25).describe('Max establishments to return (1-100, default 25)'), }, - src/modules/economy.ts:16-64 (registration)The tool is registered via server.tool('reunion_search_sirene_establishments', ...) inside registerEconomyTools(server) function, which is called from registerAllTools in src/modules/index.ts, which is called from main() in src/index.ts.
server.tool( 'reunion_search_sirene_establishments', 'Search the SIRENE v3 national business registry, restricted to establishments located in La Réunion. Each establishment has a 14-digit SIRET (= 9-digit SIREN of the legal entity + 5-digit NIC). Returns SIREN/SIRET, denomination, usual name, brand, head-office flag, administrative state (active/closed), creation date, NAF activity code, workforce bracket, full address, postal code, commune, legal form, ESS (économie sociale et solidaire) status. Source: INSEE Sirene via data.regionreunion.com.', { query: z.string().optional().describe('Free-text search across denomination, usual name, brand, address, activity'), siren: z.string().optional().describe('Exact 9-digit SIREN of the legal entity (unité légale)'), siret: z.string().optional().describe('Exact 14-digit SIRET of the establishment'), commune: z.string().optional().describe('Commune name prefix match (e.g. "Saint-Denis")'), naf: z.string().optional().describe('NAF/APE activity code prefix match. Examples: "47" for retail, "47.11" for hypermarkets, "56.10A" for traditional restaurants, "62" for IT'), limit: z.number().int().min(1).max(100).default(25).describe('Max establishments to return (1-100, default 25)'), }, async ({ query, siren, siret, commune, naf, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_SIRENE, { where: buildWhere([ query ? `search(${quote(query)})` : undefined, siren ? `siren = ${quote(siren)}` : undefined, siret ? `siret = ${quote(siret)}` : undefined, commune ? `libellecommuneetablissement LIKE ${quote(`${commune}%`)}` : undefined, naf ? `activiteprincipaleetablissement LIKE ${quote(`${naf}%`)}` : undefined, ]), limit, }); return jsonResult({ total_establishments: data.total_count, establishments: data.results.map((row) => ({ siren: pickString(row, ['siren']), siret: pickString(row, ['siret']), denomination: pickString(row, ['denominationunitelegale']), usual_name: pickString(row, ['denominationusuelleetablissement']), brand: pickString(row, ['enseigne1etablissement']), is_head_office: pickString(row, ['etablissementsiege']), state: pickString(row, ['etatadministratifetablissement']), creation_date: pickString(row, ['datecreationetablissement']), activity_code: pickString(row, ['activiteprincipaleetablissement']), workforce_bracket: pickString(row, ['trancheeffectifsetablissement']), workforce_year: pickString(row, ['anneeeffectifsetablissement']), address: pickString(row, ['adresseetablissement']), postal_code: pickString(row, ['codepostaletablissement']), commune: pickString(row, ['libellecommuneetablissement']), legal_form: pickString(row, ['categoriejuridiqueunitelegale']), ess: pickString(row, ['economiesocialesolidaireunitelegale']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to search SIRENE'); } } );