Skip to main content
Glama

verifier_site_actif

Read-onlyIdempotent

Vérifie si un établissement de santé FINESS est encore en activité en croisant FINESS DREES ↔ RPPS (pivot SIRET) ↔ DINUM (liste complète des SIRET du SIREN, incluant les fermés). Détecte les SIRET fermés encore listés actifs côté FINESS (DREES a 1-2 mois de retard).

V0.16 — fix succession M&A : quand un site a changé d'exploitant (rachat), l'ancien SIRET fermé et le repreneur actif coexistent à la même adresse. Le resolver privilégie désormais le SIRET ACTIF co-localisé avec le FINESS (distance géodésique ≤ 100 m, recalibré V0.16.1 — le géocodage DREES place le point FINESS à plusieurs dizaines de mètres de l'adresse réelle) — avant, le verdict pouvait être ferme à tort, le best_match étant choisi sur la seule ressemblance d'adresse. Parmi les co-localisés, seul l'actif de la bande la plus proche prime : un voisin actif d'une autre adresse ne bascule pas le verdict. Un site RÉELLEMENT fermé reste ferme (aucun SIRET actif co-localisé).

Logique :

  1. Lookup FINESS pour récupérer raison sociale + adresse + téléphone DREES

  2. SIRET candidats via le resolver : pivot RPPS, puis fallback géo DINUM /near_point (récupère TOUS les SIRET autour de l'adresse FINESS, actifs ET fermés — capte le repreneur invisible côté RPPS)

  3. best_match = le SIRET ACTIF co-localisé avec le FINESS s'il en existe un ; sinon le meilleur candidat (possiblement fermé). La co-localisation est une distance géo, pas un score textuel.

  4. 2 verdicts distincts :

  • verdict_site (actif / ferme / indetermine) : basé sur best_match.actif. C'est le verdict qui compte pour un audit territorial.

  • verdict_groupe (actif / ferme / indetermine) : basé sur l'état admin de l'UL parente (champ actif DINUM). Une UL active peut très bien avoir un site fermé.

Format de retour : objet LookupResult discriminé par found. Quand found: true, le payload contient finess (vue DREES), candidates (liste enrichie — chaque candidat porte distance_finess_m), best_match, sirens_explored, verdict_site, verdict_groupe, succession ({ detected, exploitants_precedents } — les SIRET fermés co-localisés avec le repreneur ; fait brut, le tool ne qualifie PAS de « rachat »), explication. Quand num_finess est absent de FINESS DREES, le tool retourne {found: false, lookupStatus: 'not_found', message, ...}.

Coût : 1 RPC FINESS + 1 SELECT rpps + N appels DINUM (N = nombre de SIREN distincts, typiquement 1). DINUM gère son propre fallback INSEE V3.11 pour les SIREN diffusion partielle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
num_finessYesNuméro FINESS exact (9 chiffres).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoClé recherchée (SIREN, num_finess, code INSEE, …).
foundYes
messageNoExplication actionnable quand `found=false` (cause probable + remédiation).
lookupStatusYes

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint, idempotentHint, destructiveHint false. Description adds cost details (RPC, SELECT, DINUM calls) and explains version-specific fixes and edge cases. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with paragraphs and bullet points, but quite verbose with technical details like version numbers and distances. Could be more concise without losing key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (multi-source, two verdicts, output schema), the description covers all important aspects: logic, edge cases (succession, collocation), cost, and output format. Very complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter 'num_finess' with schema description 'Numéro FINESS exact (9 chiffres).' Description does not add further semantics. Since schema coverage is 100%, baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it 'Vérifie si un établissement de santé FINESS est encore en activité' and details cross-referencing multiple sources. This distinguishes it from sibling tools like 'etablissement_by_finess' which likely returns general info.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive logic (lookup steps, two verdicts, handling of successions) but does not explicitly state when to use this tool vs alternatives. The detailed algorithm helps the agent infer correct usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation3/5

While tools have distinct purposes, there is overlap among several similar tools (e.g., multiple professional and establishment search tools). The detailed descriptions help differentiate, but an agent may struggle to choose correctly among them.

Naming Consistency2/5

Naming mixes French and English, with no consistent pattern (e.g., 'enrichir_concurrents' vs 'inspect_site', 'etablissement_by_finess' vs 'etablissements_finess_in_radius'). This inconsistency makes the toolset harder to navigate.

Tool Count3/5

36 tools is high but justified given the broad domain. However, there are multiple tools for similar tasks (e.g., four professional search tools), suggesting some redundancy. The scope is borderline but acceptable.

Completeness4/5

The toolset covers a wide range of needs for French health data analysis: establishments, professionals, population, geocoding, demographics, and composite analyses. Few obvious gaps exist, though some specialized tasks might require additional integration.