Skip to main content
Glama

data_freshness

Read-only

Retourne la fraîcheur des dumps de données ingérés côté serveur : FINESS / ANS (flux quotidien, ingéré le 1er et le 15 du mois), Annuaire Santé Ameli (hebdomadaire), RPPS / Annuaire Santé ANS (mensuel), Centres de Santé CNAM (hebdomadaire), IRIS INSEE (annuel), permis de construire Sit@del / SDES (mensuel, cron le 10), ventes immobilières DVF / DGFiP (livraison semestrielle, cron le 12). Pour chaque source : last_data_change_at + data_age_days (dernier run ayant RÉELLEMENT changé la donnée servie, et son âge en jours — C'EST LE CHAMP À LIRE), last_success_at + staleness_days (dernier run réussi, y compris un run court-circuité « fichier amont identique » — ne mesure PAS l'âge de la donnée), last_success_row_count, last_attempt_at, last_attempt_status, cadence_hint (cadence attendue).

Usage typique : avant un audit territorial ou une analyse temporelle, le caller appelle ce tool pour savoir si les données sont à jour. Juger sur data_age_days, JAMAIS sur staleness_days seul : en 2026 la source FINESS s'est tarie 4 mois pendant que staleness_days restait à quelques jours (runs « fichier identique » comptés comme succès). Règle d'alerte : data_age_days > expected_max_age_days (seuil par source, exposé dans chaque ligne — ne pas le recopier) ; data_age_days: null = jamais ingéré.

Les sources LIVE (DINUM Recherche Entreprises, INSEE SIRENE V3.11, ANS FHIR live) ne sont PAS listées ici puisqu'elles n'ont pas de cycle d'ingestion — leur fraîcheur est celle des API amont (live, ~secondes).

Cache serveur : 5 minutes. Coût : 1 SELECT sur ingest_log au pire (sinon hit cache).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "data_freshness"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
sourcesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedOutput schema / properties / sources / items / properties / data_age_days
      Added value: +{
      +  "description": "Âge de la donnée servie, en jours, depuis last_data_change_at. C'est CE champ qui dit si la donnée est périmée (post-mortem FINESS 2026-09 : staleness_days=4 pour une donnée de 113 jours).",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / sources / items / properties / expected_max_age_days
      Added value: +{
      +  "description": "Âge maximal attendu de la donnée pour cette source, en jours. Règle d'alerte : data_age_days > expected_max_age_days.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / sources / items / properties / last_data_change_at
      Added value: +{
      +  "description": "ISO timestamp du dernier run ayant RÉELLEMENT changé la donnée servie (success/partial sans court-circuit). null si aucune ingestion réelle n'a jamais abouti.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / sources / items / properties / last_success_at / description
      Previous value: -"ISO timestamp dernière ingestion OK. null si aucun succès enregistré (1er déploiement)."New value: +"ISO timestamp du dernier run dont le swap a réussi — statut `success` OU `partial` (swap OK, couche secondaire matview/canary en échec : la donnée est servie). null si aucun succès enregistré (1er déploiement)."
    • changedOutput schema / properties / sources / items / properties / staleness_days / description
      Previous value: -"null si la source n'a jamais été synchronisée (signal alarmant à propager au caller)."New value: +"Jours depuis le dernier run réussi — y compris un run court-circuité « fichier amont identique ». NE mesure PAS l'âge de la donnée : utiliser data_age_days. null si la source n'a jamais été synchronisée (signal alarmant à propager au caller)."
  2. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the read-only safety profile; the description adds the server-side 5-minute cache, the worst-case cost (one SELECT on `ingest_log`), and the crucial operational caveat that short-circuited "fichier amont identique" runs count as successes — backed by the 2026 FINESS incident. This is exactly the kind of failure-mode context annotations cannot express.

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?

Well front-loaded: purpose, then per-source cadence, then field semantics, then usage rule, then cache/cost. The source enumeration with parenthetical cron details is long but genuinely informative; a couple of nested parentheses could be trimmed without loss.

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?

Although an output schema exists, the description supplies the interpretive layer that a schema cannot: which field is authoritative, how to threshold it, what null means, and why the naive metric is misleading. Cache behavior and cost complete the picture for a no-argument tool.

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

Parameters4/5

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

Zero parameters, so the baseline is 4 and there is no parameter meaning to add. The description does invest heavily in interpreting the returned fields (`last_data_change_at` vs `last_success_at`, `staleness_days` not measuring data age), which is value beyond the empty input schema, though the output schema already carries the field list.

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?

Opens with a specific verb+resource ("Retourne la fraîcheur des dumps de données ingérés côté serveur") and then enumerates the exact sources covered with their cadences (FINESS/ANS, Ameli, RPPS, CNAM, IRIS INSEE, Sit@del, DVF). It also explicitly excludes the LIVE sources, which is what distinguishes this tool from the dozens of data-lookup siblings.

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

Usage Guidelines5/5

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

Names the concrete triggering situation ("avant un audit territorial ou une analyse temporelle"), states which field to judge on and which NOT to judge on, and gives the alert rule (`data_age_days > expected_max_age_days`) plus the null case. It also tells the caller that live sources are deliberately absent so the agent doesn't hunt for them here.

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.