Skip to main content
Glama

Search the law corpus

well_search_law
Read-only

Search the stored official law of one country by keywords, as of a date. FR: the LEGI codes, the BOFiP tax doctrine in force and the Service-Public.fr business fiches. US: the United States Code Title 26, the eCFR Title 26, the IRS documents of the Federal Register, the GovInfo editions and the IRS publications.

Write the query in the language the law is written in: French with its accents for FR ("frais de repas déductibles", not "frais de repas deductibles"), English for US.

A long text is stored in parts: each hit is the part that holds the words, and its title ends in (k/n), part k of n.

Every hit carries its source_id, its validity and its dates. Read an article with well_get_law_article before you rely on it. validity: "unknown" means the source gives no in-force dates, and observed_from is only the day the source published the text. end_unknown means the source says the text ends or has ended but gives no end date.

On beyond_coverage, say the stored law is verified only through covered_through, and ask again with an as_of on or before that date when a past date answers the question.

This is not legal advice and not a web search.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "country": "<country>",
      "query": "<query>"
    },
    "name": "well_search_law"
  }
}

Input Schema

NameRequiredDescriptionDefault
as_ofNoThe day the law must be in force on. Omit for the latest verified day.
queryYesThe keywords, in the language of the country's law: French with accents for FR, English for US.
countryYesThe country whose law to search.
sourcesNoThe sources to search. Omit to search every source of the country.
workspace_idNoTarget workspace. Optional: this tool describes the token itself rather than one workspace's data, so omitting it returns the same answer.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.

Output Schema

NameRequiredDescriptionDefault
hitsNo
as_ofNo
statusYes
messageNo
refusalNo
successYes
coverageNo
hits_cutNo
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark this as a non-destructive read, yet the description still adds non-obvious behavior: long texts are split into parts whose titles end in (k/n), every hit carries source_id, validity and dates, validity 'unknown' means no in-force dates are given, and end_unknown means an end exists but is undated. It also explains the beyond_coverage response state, which is the kind of detail annotations cannot carry.

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?

Front-loaded with the core action, then organizes corpus contents, query-language rules, hit structure, validity caveats and coverage fallback into distinct paragraphs. Dense but nearly every sentence carries operational information; the per-country source inventory is the longest stretch and could be trimmed for readers who only need FR or US.

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

Completeness4/5

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

An output schema exists, yet the description still pre-explains the hit fields and the beyond_coverage state, which is exactly what an agent needs to interpret results correctly. Remaining gaps are the unstated country coverage limit and no mention of result-count limits or pagination for a keyword search.

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 goes beyond it by mapping each `sources` enum value to a plain-language corpus (legi, bofip, service_public, us_code, ecfr, federal_register, govinfo, irs_publication) and by reinforcing the language/accent rule for `query`. It does not clarify why `workspace_id`, `workspace_scope` or `conversation_id` matter here beyond what the schema text already says.

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 first sentence gives a specific verb and resource with scope: 'Search the stored official law of one country by keywords, as of a date.' It then enumerates exactly what the corpus contains per country (LEGI/BOFiP/Service-Public for FR; USC Title 26/eCFR/IRS for US), and explicitly disclaims being a web search, which separates it from well_search_web and points to well_get_law_article for the read step.

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?

Clear guidance on query language and accents, on following up with well_get_law_article before relying on a hit, and on what to do when a hit reports beyond_coverage (retry with an as_of on or before covered_through). It stops short of stating that only FR and US are actually covered despite the country enum listing ~250 countries, which is the one exclusion an agent most needs.

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