Skip to main content
Glama

Keyword search over statute text

search_statute_text
Read-onlyIdempotent

Keyword (BM25) search over the body text of statute sections and, in the default source, Kansas administrative regulations, in the same snapshot as the get_statute tool; source= searches one regulation source alone. Without jurisdiction=, results mix states: on 6,852 benchmark housing-law questions run unconfined, the top-ranked section came from a state other than the asker’s in 97.7% of them. Each row carries its jurisdiction, corpus and as_of; statute and regulation rows can appear together. Rank is textual match strength only. Keyword, not concept, with no stemming: very common words are dropped, duplicates collapse, at most 40 words run, matched any-of, so a top hit may share one word with the query; terms_searched and terms_dropped report what ran, and "double quotes" require a phrase. Only the body is searched, not the heading. Scores drift in their last digits between restarts, so close rows can swap places. Returns metadata, a snippet with [hl]...[/hl] marks and a rank; the get_statute tool returns the full section. A section not returned is a miss, not an absence. ends_at_colon is flagged as in the get_statute tool. A missing keyword index returns a visible 503, not zero matches. Every response, including 400 and 503, carries "note" and "coverage_note". The describe_sources tool returns this tool’s full coverage statement and, per source code, its coverage and counts.

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": {
      "q": "<q>"
    },
    "name": "search_statute_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYeswords to match in the statute section text. A full natural-language question is fine: common words are dropped and the rest matched ANY-OF, so more words widen the search rather than narrowing it. "double quotes" for a phrase that must appear together
limitNomax results, default 20, capped at 50
titleNoonly with source=: narrows the search to one title, part or chapter of that source; the forms per source are given by describe_sources(tool="search_statute_text", source=<code>)
sourceNoomit for statutes and Kansas regulations; a regulation source code ("cfr" for federal, or a state code) searches that source alone; each code’s coverage is given by describe_sources(tool="search_statute_text", source=<code>)
jurisdictionNorestrict to one jurisdiction, e.g. "ks" or "us". STRONGLY preferred when the user’s state is known: without it results mix states

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds substantial behavior: no stemming, common-word dropping, 40-word cap, ANY-OF matching, phrase quoting, body-only search, snippet [hl] marks, rank drift across restarts, visible 503 on missing index, and note/coverage_note on every response. A minor gap is that pagination/offset behavior for limit isn't discussed. Strong disclosure beyond annotations.

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 and nearly every clause carries information, but it is one dense run-on paragraph mixing relevance semantics, error behavior, and cross-references. Slightly harder to scan than a segmented version would be; no clearly wasted sentences.

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?

No output schema exists, and the description compensates by describing the row shape (jurisdiction, corpus, as_of, snippet, rank), the error envelope, and the distinction between a miss and an absence. For a 5-parameter search tool this is sufficient for correct invocation and interpretation.

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 adds real meaning: jurisdiction's effect on mixing states, source= restricting to a regulation corpus, and the fact that title is only valid alongside source. It doesn't restate enum values or limits, which is correct given the schema.

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?

States a specific mechanism and resource: "Keyword (BM25) search over the body text of statute sections" plus regulations in the default source. It explicitly marks itself as keyword-not-concept, which separates it from search_by_concept and search_opinion_text without opening either schema.

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?

Gives concrete routing rules: use jurisdiction= when the user's state is known (with the 97.7% cross-state benchmark as justification), use source= to search one regulation source alone, use get_statute for the full section text, and use describe_sources for coverage. It also states the when-not condition (conceptual search).

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