Skip to main content
Glama

japan-legislation-mcp-server

Search Japanese Law Text

jplaw_search_text
Read-onlyIdempotent

Search Japanese statutes across laws for highlighted previews grouped by law. Filter with sections and continue with next_offset and the same filters. Read exact text with jplaw_get_law or jplaw_get_provision. Supply law or law_revision_id for literal search of paragraphs, their inline tables and lists, and article captions. Reopen a scoped match with its selector as jplaw_get_law.part or, when present, its address as a jplaw_get_provision.provisions entry. Pin the returned revision for reads and paging. Restart if revision.updated changes.

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": {
      "keyword": "<keyword>"
    },
    "name": "jplaw_search_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
lawNoExact law ID, Japanese number, title, or abbreviation for scoped search.
asofNoCalendar date YYYY-MM-DD from 2017-04-01. Omit for the current version.
limitNoMaximum snippets or scoped matches per page. Values above 1000 are served at 1000.
offsetNoUpstream snippet or scoped match offset. Pass the previous next_offset.
keywordYesJapanese body text. Across laws use space (AND), | (OR), ! (NOT), or * and ? wildcards. In one revision, join literal terms by whitespace (AND within one provision).
sectionsNoCross-law snippet sections. The search scans later pages to fill the limit.
law_typesNoCross-law filter for law types.
categoriesNoCross-law filter for category codes from jplaw_list_reference.
law_revision_idNoExact revision ID for scoped search. Mutually exclusive with asof.

Output Schema

NameRequiredDescriptionDefault
countNoSnippets or scoped matches on this page.
errorNoPresent when the call failed. Absent on success.
limitNoEffective page limit.
queryNoApplied search expression, filters and date.
groupsNoCross-law previews grouped by law and revision in law-ID order. Empty in scoped mode.
offsetNoRequested offset.
scopedNoResult when searching one law revision.
noticesNoGuidance on search interpretation or continuation.
truncatedNoWhether this search has a continuation.
incompleteNoTrue if a cross-law scan reached its deadline. Continue with next_offset and the same filters.
attributionNoSource credit and processing statement.
next_offsetNoNext upstream snippet or scoped match offset, or null when exhausted.
upstream_total_countNoTotal reported by e-Gov before section filtering.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and openWorld, so the safety profile is covered. The description adds genuinely useful behavior beyond them: paging via next_offset with the same filters, revision pinning for consistent reads and paging, and restarting when revision.updated changes. It does not describe rate limits or truncation, but the staleness and paging guidance is substantive.

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?

About six sentences, front-loaded with the purpose, with no filler. Some later sentences are so compressed that they approach cryptic ('Pin the returned revision for reads and paging', 'Restart if revision.updated changes'), which costs a little clarity without adding waste.

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 and annotations cover the safety profile, so the description need not explain return values. It still covers the two search modes, pagination continuation, revision pinning, and follow-up tool routing, which is enough for an agent to call it correctly; only the sibling law-search distinction is missing.

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?

Schema description coverage is 100%, so the schema already documents all nine parameters, including the keyword operators, asof, sections, and law_revision_id exclusivity. The description reinforces the mode switch between cross-law search and literal in-revision search, but mostly restates what the schema provides rather than adding new meaning, so the baseline 3 applies.

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?

The first sentence gives a specific verb, resource, and result shape ('Search Japanese statutes across laws for highlighted previews grouped by law'), and later sentences distinguish this tool from jplaw_get_law and jplaw_get_provision. It stops short of contrasting with jplaw_search_laws, whose name implies a different (law-level) search, leaving that boundary for the agent to infer.

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 gives clear routing rules: use this tool for previews, use jplaw_get_law or jplaw_get_provision to read exact text, and supply law or law_revision_id to switch to literal in-revision search. It also explains how to reopen a scoped match through the sibling tools' fields. The one gap is that it never says when NOT to use this tool in favor of the sibling law-search tool.

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.