Skip to main content
Glama

Rechercher dans les codes (Légifrance)

rechercher_codes_via_search
Read-onlyIdempotent

Outils de de recherche avancee spécialisé dans les codes juridiques.

Capacites principales:

  • Chercher en EXACT, PROXIMITE ou LARGE.

  • Cibler un ou plusieurs codes via leurs noms complets.

  • Cibler TABLE (dans la table des matieres), ALL (dans tous les champs), ARTICLE (dans le contenu des articles uniquement).

  • Strategie progressive: EXACTE puis PROXIMITE si < 10 resultats, puis LARGE si < 10 résultats.

  • Fusionne les resultats sans doublons, ordre par priorite (exact -> proximite -> large).

  • Chaque niveau recupere jusqu'a 50 resultats tries par pertinence.

  • Par defaut, ne garder que les elements en vigueur. Si la question vise une periode pas actuelle ou si l'utilisateur le demande, utiliser mode_etats="historique" (inclut MODIFIE/ABROGE) ou "tous".

  • La sortie est compacte: titres + sections + extraits d'articles uniquement. Ce tool sert a identifier des articles/passages candidats; il ne suffit pas, a lui seul, pour affirmer le contenu integral d'un article. Il faut ensuite passer par l'etape de consultation complete appropriee.

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": "rechercher_codes_via_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
codes_nomsNoNoms complets de codes (ex: "Code du travail").
mode_etatsNo"vigueur" (defaut), "historique" ou "tous".vigueur
champs_ciblesNoChamps cibles (TABLE, ALL, ARTICLE).
recherches_largesNoTermes uniques pour recherche large.
recherches_exactesNoExpressions exactes.
recherches_proximiteNoGroupes de mots a proximite.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds substantial behavior: up to 50 results per level sorted by relevance, deduplicated merging ordered exact to proximite to large, default filtering to in-force items with MODIFIE/ABROGE included only on request, and a compact return shape of titles, sections and extracts. It further warns the output is insufficient on its own to assert an article's full content, which is exactly the kind of limitation an agent needs before relying on results.

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?

Purpose is front-loaded in the first line and the bulleted capability list is easy to scan; each bullet carries operative information rather than filler. Minor redundancy (the 'outils de de recherche' typo and repeated mention of result limits) costs little but keeps it off a 5.

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?

For a six-parameter, zero-required-parameter search tool with no output schema, the description covers the return shape, the per-level result cap, default filtering, and the required follow-up consultation step. An agent has enough to invoke it correctly and to know its results are candidate-level only.

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?

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning: TABLE is glossed as the table of contents, ALL as all fields, ARTICLE as article body only, and mode_etats values are expanded (historique includes MODIFIE/ABROGE, plus 'tous'). It does not explain how the three recherche arrays interact when several are supplied, nor what an empty codes_noms implies, which are the remaining gaps.

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

Purpose4/5

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

Names a specific verb (recherche avancée) and a precise resource (codes juridiques), and the capability bullets make clear it searches within legal codes rather than other Légifrance content families. It stops short of naming a sibling it must not be confused with, so an agent must rely on the resource noun alone to distinguish it from the other 'rechercher_*' tools.

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?

Gives concrete when-to-use logic: a progressive strategy (EXACT, then PROXIMITE under 10 results, then LARGE), and an explicit condition for switching to mode_etats="historique" or "tous" when the question is not about the present period. It also states the tool is for identifying candidate passages and must be followed by a full-consultation step, though it does not name that follow-up sibling, leaving the routing partly to inference.

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.

Resources