Houki e-Gov MCP Server
An MCP server that fetches Japanese laws (constitution, statutes, cabinet orders, ministerial ordinances, rules) from the e-Gov Law API v2, with abbreviation resolution and optional local full-text search.
search_law— keyword/abbreviation search over law titles, filterable bydomain(tax, labor, accounting, commercial, civil, administrative),law_type, andlimit.get_law— retrieve provisions at article/paragraph/item level, with a point-in-time option (at), and output asmarkdown,json, ortoc.get_toc— fetch only the table of contents (saves tokens), with adepthcap for large laws like the Civil Code.search_fulltext— cross-law full-text search of provision bodies via local SQLite FTS5 (falls back to API/search_lawwhen no bulk DB is built); supports space-separated AND queries anddomain/law_typefilters.resolve_abbreviation— resolve an abbreviation or nickname (e.g. 消法, 労基法) to its official law name andlaw_id.get_law_revisions— list amendment history (promulgation date, effective date, amending law number, status), optionally limited to the latest N.explain_law_type— explain a law type's enacting body, hierarchy, binding force, and practical notes; also accepts aliases like 施行令 → 政令.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Houki e-Gov MCP Server消費税法30条1項を見せて"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
旧リポジトリ名houki-hub-mcp / 旧 npm 名 @shuji-bonji/houki-hub-mcp は使っていません。
現行は @shuji-bonji/houki-egov-mcp です。
Houki e-Gov MCP Server
日本の法令(憲法・法律・政令・省令・規則)を e-Gov 法令API v2 経由で取得する MCP サーバ。
LLM が条文をキーワード・略称・分野で検索したり、特定の条項を Markdown / JSON で取得したり、改正履歴を引いたりできるようにする。
提供ツール
Tool | 用途 |
| 法令タイトルでキーワード検索(略称→正式名解決済み) |
| 条/項/号レベルで本文取得(Markdown / JSON / TOC) |
| 目次のみ取得(トークン節約) |
| 改正履歴を取得(公布日・施行日・状態) |
| 条文本文の横断全文検索(ローカル SQLite FTS5。bulk DB 未構築時は |
| 略称→正式名解決の診断 |
| 法令種別(憲法・法律・政令・省令・通達 等)の解説 |
略称辞書(174 エントリ・6 分野)は @shuji-bonji/houki-abbreviations を内部で利用しています。
Related MCP server: e-Gov Law MCP Server
インストール
Claude Desktop で使う
// claude_desktop_config.json
{
"mcpServers": {
"houki-egov": {
"command": "npx",
"args": ["-y", "@shuji-bonji/houki-egov-mcp"]
}
}
}Claude Code plugin で使う
リポジトリ同梱の .claude-plugin/plugin.json が MCP server として npx -y @shuji-bonji/houki-egov-mcp@latest を登録します。plugin として入れた場合も、下の「Claude Desktop で使う」も、起動されるのは npm に公開された同じパッケージです。
ローカル開発
git clone git@github.com:shuji-bonji/houki-egov-mcp.git
cd houki-egov-mcp
npm install
npm run build
npm test// 開発中の動作確認 (.mcp.json)
{
"mcpServers": {
"houki-egov-local": {
"command": "node",
"args": ["/absolute/path/to/houki-egov-mcp/dist/index.js"]
}
}
}使用例
# LLM への問いかけ → MCP ツール呼び出し
「消費税法30条1項を見せて」
→ get_law(law_name="消法", article="30", paragraph=1)
「消費税法2条1項8号の2(特定資産の譲渡等)を見せて」
→ get_law(law_name="消法", article="2", paragraph=1, item="8の2")
「労働基準法の目次を取得」
→ get_toc(law_name="労基法")
「個人情報保護法の改正履歴を最新5件」
→ get_law_revisions(law_name="個情法", latest=5)
「電帳法って正式名称なに?」
→ resolve_abbreviation(abbr="電帳法")
→ 電子計算機を使用して作成する国税関係帳簿書類の保存方法等の特例に関する法律
「政令と省令の違いは?」
→ explain_law_type(name="政令")
「民法で不法行為について定めている条文は?」(bulk DB 構築後)
→ search_fulltext(keyword="民法 不法行為")
→ law_scope=[民法] に絞って本文検索。724 条・719 条・509 条 などが snippet 付きで返る
「民法 第709条」(法令名 + 条番号だけ)
→ search_fulltext(keyword="民法 第709条")
→ 本文検索をせず、民法 709 条を直接返すCLI(ローカル DB の構築 — v0.3.1+)
全文検索用のローカル DB(SQLite FTS5)は、e-Gov の bulk ダウンロード zip から構築します。MCP server として常駐する通常起動とは別に、フラグ付きで起動すると CLI モードで動作します。
# 全法令 zip (約 290 MB) を DL して DB に取り込む
npx @shuji-bonji/houki-egov-mcp --bulk-download-everything
# DB の件数と鮮度 (freshness) を表示
npx @shuji-bonji/houki-egov-mcp --statusDB のデフォルト配置は ${XDG_CACHE_HOME:-~/.cache}/houki-egov-mcp/laws.db(HOUKI_EGOV_DB_PATH で変更可)。
SQLite と DB の置き場所(npx / plugin 経由で使う場合)
SQLite は本パッケージが依存する better-sqlite3 に同梱されています(SQLite 3.53 系の amalgamation。OS の sqlite3 は使いません)。npx や plugin で初めて起動したときに npm が better-sqlite3 を取り込み、実行中の Node.js と OS に合ったビルド済みバイナリ(prebuild-install)を GitHub Releases から取得します。対応する prebuilt がない Node.js の場合は node-gyp でその場でコンパイルするため、Python と C++ ビルドツール(macOS なら Xcode Command Line Tools)が必要になります。Node 22 / 24 の LTS では prebuilt が用意されているので、通常はコンパイルは走りません。
DB ファイルはパッケージの中ではなく、上記のユーザーのキャッシュディレクトリに置かれます。したがって次の 3 つは 同じ 1 つの DB を読み書きします。
起動方法 | 実行されるコード | 読む DB |
| npx のキャッシュ内のパッケージ |
|
Claude Desktop / Claude Code plugin( | 同上( | 同上 |
ローカル開発( | リポジトリの | 同上 |
このため、DB の構築は一度 CLI で行えば、plugin 経由の search_fulltext からもそのまま使えます。--bulk-download-everything のあとに MCP server を再起動する必要はありません(search_fulltext は呼び出しごとに DB を開いて閉じます)。書き込みは CLI だけが行い、MCP server は読むだけです(journal は WAL なので、取り込み中に検索しても壊れません)。
DB が存在しない、または条が 1 件も入っていないときは、search_fulltext は source: "api-fallback" で search_law の結果を返し、next_actions に --bulk-download-everything の実行を案内します。パッケージを更新しても DB は消えません(バージョン間の互換は上の注記のとおり、必要なときだけ再構築を案内します)。
DB を構築すると search_fulltext が条文本文を SQLite FTS5 で検索します(v0.5.0〜)。略称は正式名称に OR 展開され(消法 → 消費税法)、「民法 不法行為」「労基法 時間外」のように法令名と語を並べるとその法令の条に絞って本文を検索します。各ヒットに条番号・snippet・score・DB の鮮度(freshness)が付きます。DB が未構築のときは従来どおり search_law(法令名のタイトル一致)にフォールバックし、note でその旨を返します。
v0.5.0 以前に構築した DB について: v0.5.0 で本文の正規化を投入時に行うようになり(スキーマバージョン 2、旧 DB は起動時に自動初期化)、v0.5.1 で編(Part)を持つ法令の本則が取り込まれていなかった不具合を直しました。いずれの場合も
--bulk-download-everythingを再実行してください(v0.5.1 では全件が再 ingest されます)。検索語の制約: 索引が trigram のため、条文本文は 3 文字以上の語で引きます。2 文字の語(「保存」「民法」等)は、3 文字以上の語と組み合わせたときは本文の AND 絞り込みに、単独のときは法令名・略称の照合にだけ使われます。「第30条」のような条番号は本文検索には使わず、該当条を上位に寄せる加点にだけ使います(漢数字は未対応)。
状態
v0.6.0 (2026-09-12)
e-Gov 法令API v2 クライアント(
searchLaws/getLawData/getLawRevisions)法令ツリー走査(条/項/号、目次抽出)+ LRU cache
7ツール本実装
略称辞書を
@shuji-bonji/houki-abbreviations^0.4.1 に分離法令階層ナレッジ(憲法・法律・政令・省令・規則・条例・告示・訓令・通達・通知 の10種別)
houki-hub family 共通の error contract(
SOURCE_*/OUT_OF_SCOPE)に準拠Phase 2 基盤:bulk DL → SQLite FTS5 の取り込みパイプライン(schema / CSV・XML parser / zip fetcher / ingester / freshness / CLI)
Phase 2-7:
search_fulltextの FTS5 本実装(略称 OR 展開 / revision 重複排除 / relevance scoring / freshness)MCP SDK v2(
@modelcontextprotocol/server)/ Node 22・24 / TypeScript 7 / BiomeTrusted Publisher (OIDC) で publish
get_lawのitemで枝番号の号("8の2"・"第8号の2")を指定(v0.6.0)ツールの引数の型を inputSchema から導き(json-schema-to-ts の
FromSchema)、未知の引数はINVALID_ARGUMENT(v0.6.0)テストスイート(287 tests)
計画中
Phase 2-8: 差分同期(
--bulk-download-incremental)Phase 2-13: API enrichment(
category/ 改正履歴 / 廃止ステータスの精緻化)漢数字対応(「第三十条」を 30 に変換)
大規模法令の応答サイズ対策(民法・会社法)
houki-hub MCP family
houki-egov-mcp は 単体で利用可能ですが、houki-hub MCP family の一員でもあります。同じ family 内の他 MCP と組み合わせると、通達・判例等まで横断的に扱えます。
パッケージ | 役割 | 状態 |
略称辞書・正規化・freshness 判定(共有ライブラリ) | ✅ v0.5.0 | |
| e-Gov 法令API クライアント + ローカル全文検索(このリポジトリ) | ✅ v0.5.1 |
国税庁通達・Q&A・タックスアンサー・文書回答事例 | ✅ v0.9.5 | |
family を横断する Claude Skill(error contract の正典) | ✅ | |
| 厚労省通達・通知 | 計画中 |
| 判例(裁判所サイト) | 構想中 |
| 国税不服審判所裁決 | 構想中 |
family 全体の設計思想・想定利用シーン・業法との関係は docs/DESIGN.md を参照。
エラー応答 (houki-hub family contract)
v0.3.0 より、本 MCP のエラー応答は houki-hub family 共通契約に完全準拠します。code 文字列は family 全体で統一された語彙を使用するため、複数の MCP を併用しても LLM・Skill 層は一貫したロジックで解釈できます。
docs/ERROR-CODES.md— 共通エラーコード語彙の正典 (houki-research-skill)docs/ERROR-HANDLING.md— 解釈ポリシー / next_actions テンプレ
houki-egov-mcp の src/errors.ts は family 全体の リファレンス実装として位置付けられています。他 MCP は同じ code 語彙を共有しつつ、共通パッケージへの依存は持たずに独立実装します。
{
"error": "法令『消費税法』第3000条は存在しません",
"code": "ARTICLE_NOT_FOUND",
"hint": "条番号を get_toc で確認してください",
"next_actions": [
{ "action": "get_toc", "reason": "目次で正しい条番号を特定", "example": { "law_name": "消費税法" } }
],
"retryable": false
}本 MCP で使用するコード
code | 用途 | retryable |
| 引数が |
|
| 条番号・号番号のフォーマットが不正 (例: 未対応の漢数字) |
|
| 通達名で |
|
| 略称解決・検索のいずれでも法令が見つからない |
|
| 指定された条/項/号が見つからない |
|
| e-Gov API がエラー応答 (4xx/5xx) | 状況による |
| e-Gov API がタイムアウト |
|
| e-Gov API がレート制限 (HTTP 429) |
|
| DNS 失敗 / ECONNREFUSED 等で e-Gov に到達不能 |
|
| 内部エラー (バグ・予期せぬ例外) |
|
| 存在しない tool 名が呼ばれた |
|
Migration (v0.2.x → v0.3.0)
v0.2.x までは
EGOV_API_ERROR/EGOV_TIMEOUT/EGOV_RATE_LIMITEDを返していました。v0.3.0 からは family 共通のSOURCE_API_ERROR/SOURCE_TIMEOUT/SOURCE_RATE_LIMITEDに切替。EGOV_*はLawErrorCodeの型としては残置していますが、本 MCP からはもう発行しません。次のメジャー (v1.0.0) で削除予定。構造化エラーの形 (
{ error, code, hint?, next_actions?, retryable?, detail? }) は不変。クライアント側でcode文字列の比較をしている場合はSOURCE_*を受け付けるよう更新してください。OUT_OF_SCOPEを新たに受け取る可能性があります。例えば「消基通」(消費税法基本通達 / 国税庁の通達) をget_lawのlaw_nameに渡すと、next_actions[0].example.mcp = "houki-nta"を含むOUT_OF_SCOPEが返されるので、Skill 層は houki-nta-mcp に切り替えてください。
ドキュメント
docs/LAW-HIERARCHY.md— 法令種別の階層リファレンス(専門家でない利用者向け)docs/USE-CASES.md— プロダクト開発の典型ユースケース(電帳法・電子契約・個情法・e-KYC)docs/DESIGN.md— 設計原則・houki-hub family のロードマップ・業法との関係DISCLAIMER.md— 利用上の注意(業法との関係)CONTRIBUTING.md— 貢献方法CHANGELOG.md— リリースノート
業法との関係
本MCPは 一次情報の取得・提示のみ を担います。分析は LLM、判断は利用者(または有資格者)の責任です。業としての法律事務・税務業務への利用は想定外です — 詳細は DISCLAIMER.md 参照。
デジタル庁公式 MCP との関係
デジタル庁は 2025年12月〜2026年3月の「法令×デジタル」ハッカソンで法令API / MCP のプロトタイプを試行提供した。将来一般公開された場合は、本 MCP のコアを公式 MCP に委譲し、houki-hub family 全体は 公式が手を出さないレイヤ(通達・裁決・判例の横断インデックス、業法対応 Skill 等) に注力する方針。
ライセンス
MIT — 個人利用・学習用途のフォーク・改変・再配布を自由に許可します。
ただし、業としての使用(弁護士法72条・税理士法52条・社労士法27条が定める独占業務) については想定外であり、作者は一切の責任を負いません。DISCLAIMER.md を必ずご確認ください。
Available Tools
7 toolsexplain_law_typeA
法令種別(憲法・法律・政令・省令・規則・条例・告示・通達 等)の制定主体・階層上の位置・国民への拘束力・実務上の注意点を解説する。法務専門家でない利用者が「政令と省令の違い」「通達は守らなくていいのか」等を確認するための知識ツール。
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 法令種別の名前。例: "法律", "政令", "省令", "規則", "条例", "告示", "通達", "訓令", "憲法"。aliases も解決可(例: "施行令" → 政令、"施行規則" → 省令、"Act" → 法律) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries full burden. It accurately describes the tool as an educational/knowledge tool with no side effects. It does not mention read-only status explicitly, but the explanatory nature makes it non-destructive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence packs all necessary information (what, aspects, audience) without redundancy. Slightly dense but efficient; no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (single param, no output schema), the description fully covers its purpose, input, and expected output (explanations). No gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% coverage with a single parameter 'name' and its description. The tool description adds significant value by listing concrete examples (法律, 政令), explaining alias resolution (施行令 → 政令), and confirming the parameter's purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description explicitly states verb 'explain' and resource 'law type' (法令種別). It lists specific types (憲法・法律・政令 etc.) and aspects covered (制定主体, 階層上の位置, etc.), clearly distinguishing from siblings that retrieve actual law texts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Target audience (non-legal experts) is specified, and the purpose (confirming differences) is clear. While no explicit when-not-to-use or alternatives are stated, the sibling tools (search_law, get_law, etc.) imply this is for conceptual explanations, not text retrieval.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_lawC
日本の法令から条文を取得する。略称(消法・所法・労基法 等)対応。条/項/号レベル指定可能。
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | 時点指定。YYYY-MM-DD 形式。例: "2024-04-01" でその時点の条文を取得(e-Gov v2 対応) | |
| item | No | 号番号。省略時は項全体 | |
| format | No | 出力形式。"markdown"=条文全文(デフォルト), "toc"=目次のみ(トークン節約), "json"=構造化 | markdown |
| article | No | 条番号。例: "30", "30の2"。format="toc" の場合は省略可 | |
| law_name | Yes | 法令名または略称。例: "消費税法", "消法", "労基法", "民法" | |
| paragraph | No | 項番号。省略時は条文全体 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, and the description does not disclose behavioral traits like read-only nature, authentication needs, or any side effects. It does not mention the e-Gov v2 dependency from the parameter description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and to the point, with no unnecessary words. It is concise but could be better structured with clear separation of key features.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and multiple parameters, the description lacks completeness. It does not explain return formats, date specification, or how the 'toc' format works, leaving critical gaps for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds minimal value beyond what the schema already provides, only briefly mentioning abbreviation support and level specification.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves articles from Japanese laws and supports abbreviations and level specification. However, it does not distinguish itself from sibling tools like get_toc or search_law.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool compared to alternatives such as search_law or get_toc. The description lacks explicit usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_law_revisionsA
法令の改正履歴を取得する。e-Gov v2 /law_revisions を使用。各改正の公布日・施行日・改正法令番号・状態(現行/旧法/未施行)等を返す。
| Name | Required | Description | Default |
|---|---|---|---|
| latest | No | 最新N件のみ返却(省略時は全件)。例: 5 | |
| law_name | Yes | 法令名または略称。例: "消費税法", "消法", "民法" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
アノテーションがないため、動作特性の説明は記述に委ねられている。外部API使用と返却フィールドの列挙はあるが、読み取り専用であることやレート制限、副作用については触れられていない。最低限の情報は提供しているが、完全ではない。
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
2文で目的と返却内容を効率的に伝えており、冗長な表現がない。フロントローディングも良好。
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
パラメータ数2、必須1、出力スキーマなしという状況で、返却フィールドや外部API使用を明記しており、ツールを利用するのに十分な文脈を提供している。ページネーションやエラーハンドリングの欠如はあるが、スコープ内では良くできている。
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
スキーマですべてのパラメータに説明があり、カバレッジ100%。記述はパラメータの意味を追加で説明しておらず、ベースラインの3が適切。
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
明確に法令の改正履歴を取得する機能を説明し、e-Gov v2 APIを使用すること、返却データの内容(公布日・施行日等)を列挙している。sibling tools(get_law, get_toc)との違いが明確で、特定の動詞+リソースを備えている。
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
改正履歴を取得するという使用場面は明示されているが、代替ツール(search_law等)との使い分けや、使用すべきでない状況は明記されていない。代替案への明示的な言及がないため、最高点ではない。
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_tocA
法令の目次(編・章・節・条の構造)のみを取得する。トークン節約用。depth で階層を浅く打ち切れる(民法・会社法のような大規模法令の概観把握向け)。
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | 時点指定(YYYY-MM-DD) | |
| depth | No | 構造階層の打ち切り深さ。1=編まで、2=章まで、3=節まで。省略時は全階層。例: 民法を depth=1 で取得すると「第一編 総則」「第二編 物権」のような大区分のみが返る | |
| law_name | Yes | 法令名または略称 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries burden. It explains that depth truncates hierarchy and that the tool is for token saving, but does not disclose error handling, authentication needs, or rate limits. Acceptable for a simple retrieval tool but incomplete.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each with clear purpose: first defines core function, second adds depth parameter context and use case. No wasted words, highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so description should clarify return format. It mentions 'structure of parts, chapters, sections, articles' but not whether output is nested or flat. Missing details on behavior for invalid law names or depth values. Adequate for a simple tool, but could be more complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already provides 100% coverage with good descriptions. Tool description adds extra context by explaining depth's purpose for overview and token saving, enhancing understanding beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it retrieves only the table of contents structure, explicitly distinguishing from full law retrieval with 'のみ' (only) and token-saving purpose, and mentions depth for overview of large laws, setting it apart from siblings like get_law.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description implies usage for token-saving and large law overview via depth, but does not explicitly state when to avoid this tool or list alternative tools for full content or search, leaving guidance implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_abbreviationA
略称・通称から正式な法令名と law_id を解決する。略称辞書の内容を確認するための診断ツール。
| Name | Required | Description | Default |
|---|---|---|---|
| abbr | Yes | 略称。例: "消法", "所法", "労基法", "民" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description explains the core behavior (resolving abbreviation to law name and ID) but lacks details on error handling, multiple results, or the exact response format. It does not contradict any facts.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with purpose and usage context. Every sentence is meaningful, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (1 required param, no output schema), the description sufficiently covers functionality. It could mention the output format, but the lack is not critical for this diagnostic tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the parameter description provides examples. The tool description adds no additional semantic information beyond what the schema already provides, resulting in a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool resolves official law names and law_ids from abbreviations, and identifies it as a diagnostic tool. This distinguishes it from siblings like search_law or get_law, which serve different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly guide when to use this tool vs alternatives. Calling it a 'diagnostic tool' implies it's for checking abbreviation coverage, but no direct 'when-not-to-use' or alternative references are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_fulltextA
法令本文をキーワードで横断全文検索する。HOUKI_HUB_BULK_CACHE=1 環境時に SQLite FTS5 で動作。未有効時は API フォールバック。
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 取得件数(デフォルト: 10、最大: 30) | |
| domain | No | 分野タグで絞り込み | |
| keyword | Yes | 検索キーワード。スペース区切りで AND 検索 | |
| law_type | No | 法令種別で絞り込み |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses the cache-dependent behavior (SQLite FTS5 vs API fallback), adding valuable context beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences, front-loading the main purpose and adding a crucial behavioral note. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Moderate complexity with 4 parameters; description lacks output format or return value details, but covers core function and a key environmental behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%; description does not add new meaning to parameters beyond what schema already provides (keyword, limit, domain, law_type).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it performs full-text search across legal texts by keyword, which distinguishes it from sibling tools like search_law that likely search by law identifier.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implied usage for broad keyword search, but no explicit guidance on when to use versus competitors like search_law, or mention of prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_lawA
日本の法令をキーワード・略称・分野で検索する。e-Gov法令API v2 を使用。略称辞書による正式名称への自動補完あり。
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 取得件数(デフォルト: 10、最大: 50) | |
| domain | No | 分野タグで絞り込み(略称辞書ベース) | |
| keyword | Yes | 検索キーワード。例: "消費税", "労働基準", "育児休業"。略称も可(例: "消法", "労基法") | |
| law_type | No | 法令種別で絞り込み |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It adds useful context such as using the e-Gov API v2 and auto-completion of abbreviations, but it does not disclose safety traits (e.g., read-only nature, auth requirements, rate limits, or side effects). The description partially compensates but lacks full behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: three short sentences that are front-loaded with the main purpose, then API source, then auto-completion feature. Every sentence adds unique value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the four parameters (two with enums) and no output schema, the description is fairly complete. It covers search scope, API source, and auto-completion. However, it does not describe the return format (e.g., list of law objects with titles, dates), which would be helpful for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All four parameters are described in the schema (100% coverage), so the baseline is 3. The description adds value beyond the schema by mentioning auto-completion of abbreviations and the use of the e-Gov API v2, helping agents understand the underlying mechanism and data enrichment.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '日本の法令をキーワード・略称・分野で検索する。' (search Japanese laws by keyword, abbreviation, or field). It also specifies the use of the e-Gov law API v2 and auto-completion of abbreviations, making it distinct from siblings like get_law, search_fulltext, and resolve_abbreviation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for keyword, abbreviation, or field searches, but it does not explicitly state when to use this tool versus alternatives like search_fulltext or resolve_abbreviation. No usage exclusions or contextual cues are provided, leaving room for ambiguity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.3.1- First observed
explain_law_type - First observed
get_law - First observed
get_law_revisions - First observed
get_toc - First observed
resolve_abbreviation - First observed
search_fulltext - First observed
search_law
TDQS
Scored across 7 tools
Each tool serves a clear, non-overlapping purpose: searching by keyword, retrieving specific text, getting TOC, full-text search, abbreviation resolution, revision history, and educational explanation. No ambiguity.
All tools use the consistent verb_noun pattern in snake_case (e.g., search_law, get_law, get_toc, search_fulltext, resolve_abbreviation, get_law_revisions, explain_law_type). Perfectly uniform.
Seven tools is well-scoped for a specialized legal information server. Each tool earns its place covering search, retrieval, navigation, history, and education without redundancy.
The tool set covers all core activities: finding laws (search_law, search_fulltext), retrieving content (get_law, get_toc), resolving abbreviations, checking revisions, and understanding law types. No obvious gaps.
Maintenance
Related MCP Connectors
Japan Law MCP — Japanese national laws & ordinances via the e-Gov Law API.
Search Japanese subsidies and public company data using J-Grants, gBizINFO, and EDINET.
Japan data tools for AI agents: calendar (rokuyo), address, name splitting, corporate number lookup
Resolve, search and verify legal citations against the official sources, with provenance.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching and retrieving Japanese legal information from the e-Gov Law API, including law searches by keyword, detailed law data retrieval, and revision history tracking.31,595 npm48MIT
- AlicenseAqualityDmaintenanceEnables intelligent search and retrieval of Japanese legal statutes through the e-Gov API. Supports smart lookup of laws and articles with abbreviation recognition, batch processing, and multi-tier caching for high-performance legal research.813MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Japanese national laws and ordinances via the e-Gov Law API, allowing AI agents to access legal data through natural language questions.6 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Japanese public data (laws, corporations, statistics) from official government APIs, returning normalized English metadata with source attribution.1MIT