e-Gov Law MCP Server
Click on "Install 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., "@e-Gov Law MCP Server民法192条の条文を教えてください"
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.
e-Gov Law MCP Server v2 🏛️⚖️
Ultra Smart & Efficient - 日本政府e-Gov法令APIのための高性能Model Context Protocol (MCP) サーバー
🚀 v2の特徴: FastMCP準拠、Windows完全対応、58%コード削減、3層キャッシュ最適化、エンタープライズセキュリティ
✨ 主な特徴
🎯 インテリジェント法律検索
16基本法直接マッピング: 六法 + 現代重要法への瞬時アクセス
20略称自動変換: 道交法→道路交通法、労基法→労働基準法
複雑パターン対応: 「第325条の3」「第9条第2項第1号」等
4段階条文抽出: コンテンツスコアリングによる高精度抽出
⚡ ハイパフォーマンス
3層LRUキャッシュ: 法律検索(2h)、法律内容(1h)、条文(30m)
並行処理最適化: 50リクエスト/5.27秒の高速レスポンス
メモリ監視: psutil統合、自動クリーンアップ(512MB制限)
バッチ処理: 最大200件の一括検索対応
🛡️ エンタープライズセキュリティ
インジェクション防止: SQL、XSS、JNDI、コード実行を完全ブロック
入力検証: 長さ制限、特殊文字フィルタリング
API保護: レート制限、403 Forbidden応答
エラーマスキング: 内部情報漏洩防止
🌐 クロスプラットフォーム
Windows完全対応: psutilオプション、パス互換性
FastMCP準拠: Context logging、ToolError例外、自動シリアライゼーション
柔軟設定: YAML設定ファイル、プロンプト外部化
Related MCP server: Houki e-Gov MCP Server
🛠️ 8つの高機能MCPツール
ツール | 機能 | 特徴 |
| 条文検索 | AI駆動パターンマッチング、漢数字対応 |
| 法律検索 | フィルタリング、ページネーション |
| キーワード検索 | フルテキスト検索、ハイライト |
| 法律全文取得 | サイズ制限対応(800KB)、XML/JSON |
| バッチ検索 | 最大200件、パフォーマンス統計 |
| キャッシュ最適化 | 頻出法律の事前読み込み |
| 監視 | リアルタイムパフォーマンス監視 |
| メンテナンス | 粒度別キャッシュ管理 |
📊 対応法令
🚀 高速アクセス対応(直接マッピング済み)
六法
憲法(昭和二十一年憲法)
民法(明治二十九年法律第八十九号)
刑法(明治四十年法律第四十五号)
商法(昭和二十三年法律第二十五号)
民事訴訟法(平成八年法律第百九号)
刑事訴訟法(昭和二十三年法律第百三十一号)
現代重要法
会社法、労働基準法、所得税法、法人税法
著作権法、特許法、道路交通法、建築基準法
独占禁止法、消費者契約法、特定受託事業者取引適正化法
🔍 略称検索対応
道交法 → 道路交通法 労基法 → 労働基準法
独禁法 → 独占禁止法 消契法 → 消費者契約法
著作権 → 著作権法 特許 → 特許法
税法 → 所得税法 労働法 → 労働基準法📈 実証された性能
🏆 テスト結果(40+テスト、65%カバレッジ)
✅ 機能テスト: 全ツール、エッジケース、境界値
✅ セキュリティテスト: インジェクション攻撃、不正ペイロード
✅ パフォーマンステスト: 並行性50/50成功、5.27秒
✅ 統合テスト: FastMCP機能、Windows互換性
📊 パフォーマンス指標
並行処理: 50リクエスト同時処理 → 100%成功
キャッシュヒット率: 主要法律で90%以上
レスポンス時間: 直接マッピング法律 < 1秒
メモリ効率: 512MB制限内で安定動作
🚀 クイックスタート
前提条件
uvをインストール:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"インストール
# リポジトリをクローン
git clone https://github.com/ryoooo/e-gov-law-mcp.git
cd e-gov-law-mcp
# 依存関係をインストール
uv sync
# パフォーマンス監視を有効にする場合(オプション)
uv add psutilClaude Desktop設定
設定ファイルの場所:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/claude/claude_desktop_config.json
設定例:
{
"mcpServers": {
"e-gov-law": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/e-gov-law-mcp",
"python",
"run_server.py"
]
}
}
}💡 使用例
Claude Desktopでの基本使用
民法192条について詳しく教えて
憲法第9条第2項の条文と解釈を知りたい
会社法325条の3の株主総会決議について
労基法の有給休暇の規定を調べて
道交法の飲酒運転の罰則は?プログラム使用例
import asyncio
from fastmcp import Client
async def search_example():
async with Client(["uv", "run", "python", "src/mcp_server.py"]) as client:
# 民法192条を検索
result = await client.call_tool("find_law_article", {
"law_name": "民法",
"article_number": "192"
})
print(result[0].text)
# バッチ検索
batch_data = json.dumps([
{"law": "民法", "article": "192"},
{"law": "憲法", "article": "9"}
])
batch_result = await client.call_tool("batch_find_articles", {
"law_article_pairs": batch_data
})
asyncio.run(search_example())🔧 開発とテスト
開発環境セットアップ
git clone https://github.com/ryoooo/e-gov-law-mcp.git
cd e-gov-law-mcp
uv sync --devテスト実行
# 全テスト実行(40+テスト)
uv run pytest
# カバレッジ付きテスト
uv run pytest --cov=src
# セキュリティテスト
uv run pytest test_comprehensive_ultra.py::TestSecurityAndRobustness -v
# パフォーマンステスト
uv run pytest test_comprehensive_ultra.py::TestPerformanceAndScalability -v
# FastMCP統合テスト
uv run pytest test_fastmcp_integration.py -vコード品質
# フォーマット
uv run black src/ tests/
# リント
uv run ruff check src/ tests/
# 型チェック
uv run mypy src/⚙️ 設定
環境変数
# e-Gov API設定
export EGOV_API_URL="https://laws.e-gov.go.jp/api/2"
export EGOV_API_TOKEN="" # 通常は不要
# サーバー設定
export MCP_SERVER_NAME="e-Gov Law Server v2"
export LAW_CONFIG_PATH="config/laws.yaml"設定ファイル
config/laws.yaml: 法律マッピング、略称定義prompts/legal_analysis.md: 法的分析指導プロンプト
🏗️ アーキテクチャ
e-Gov Law MCP Server v2
├── 🎯 FastMCP Core (Context logging, ToolError, Auto-serialization)
├── 🔍 Smart Law Lookup (16 basic laws + 20 aliases)
├── ⚡ 3-Tier Cache System (LRU + TTL + Memory monitoring)
├── 🛡️ Security Layer (Injection prevention, Input validation)
├── 🌐 Cross-Platform Support (Windows/Linux/macOS)
└── 📊 Performance Monitoring (Real-time stats, Batch optimization)📝 API詳細
find_law_article
最も重要なツール - 高精度条文検索
await client.call_tool("find_law_article", {
"law_name": "民法", # 法律名(略称可)
"article_number": "325条の3" # 条文番号(複雑パターン対応)
})対応パターン例:
"192"→ 第192条"第192条"→ 第192条"325条の3"→ 第325条の3"第9条第2項"→ 第9条第2項"第9条第2項第1号"→ 第9条第2項第1号
batch_find_articles
高速バッチ処理 - 最大200件の一括検索
batch_data = json.dumps([
{"law": "民法", "article": "192"},
{"law": "憲法", "article": "9"},
{"law": "会社法", "article": "423"}
])
await client.call_tool("batch_find_articles", {
"law_article_pairs": batch_data
})🔧 トラブルシューティング
Windows環境トラブルシューティング
問題: "No module named 'yaml'" エラー
# 解決方法1: uv syncで依存関係をインストール
cd C:\path\to\e-gov-law-mcp
uv sync
# 解決方法2: 手動インストール
pip install PyYAML httpx fastmcp問題: "No module named 'psutil'" 警告
# psutilはオプションのパフォーマンス監視ライブラリ
# インストールしなくても動作します
# パフォーマンス監視を有効にしたい場合
uv add psutil
# または
pip install psutil問題: FastMCPコマンドエラー
# Claude Desktop設定でrun_server.pyを使用
# 依存関係チェック機能付き
"command": "uv",
"args": [
"run",
"--directory",
"C:\\path\\to\\e-gov-law-mcp",
"python",
"run_server.py"
]その他のWindows問題
# パス区切り文字 → pathlibで自動解決
# UTF-8エンコーディング → 明示的指定済み
# メモリ監視 → psutilなしでも動作パフォーマンス最適化
# キャッシュ統計確認
await client.call_tool("get_cache_stats", {})
# 頻出法律をプリフェッチ
await client.call_tool("prefetch_common_laws", {})
# キャッシュクリア(メモリ不足時)
await client.call_tool("clear_cache", {"cache_type": "all"})📚 参考リンク
🤝 貢献
リポジトリをフォーク
機能ブランチを作成:
git checkout -b feature/amazing-feature変更をコミット:
git commit -m 'feat: Add amazing feature'ブランチにプッシュ:
git push origin feature/amazing-featureプルリクエストを作成
貢献ガイドライン
テストカバレッジを維持(65%以上)
セキュリティテストを必須追加
FastMCP仕様準拠を確認
Windows互換性をテスト
📄 ライセンス
MIT License - 詳細は LICENSE ファイルを参照
🙏 謝辞
🚀 Ultra Smart & Efficient e-Gov Law MCP Server v2
日本法令検索の新しいスタンダード
Available Tools
8 toolsbatch_find_articlesB
Batch find multiple law articles efficiently
Args:
law_article_pairs: JSON string with law-article pairs, e.g. '[{"law":"民法","article":"192"},{"law":"憲法","article":"9"}]'
ctx: FastMCP context for logging
Returns:
Dict with batch results and performance stats
| Name | Required | Description | Default |
|---|---|---|---|
| law_article_pairs | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'efficiently' and 'performance stats' in returns, hinting at optimization, but lacks critical details: whether this is read-only or mutating, authentication requirements, rate limits, error handling, or what 'performance stats' entail. For a batch tool with zero annotation coverage, this leaves significant gaps in understanding operational behavior.
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 well-structured with a purpose statement, Args section, and Returns section, all in three sentences. It's front-loaded with the core function and avoids unnecessary fluff. However, the 'ctx' parameter in Args is not defined in the input schema, creating minor confusion that slightly reduces efficiency.
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 no annotations, no output schema, and low schema coverage, the description is moderately complete. It covers the main purpose and parameter format but misses behavioral details like safety, performance implications, and output specifics beyond 'Dict with batch results and performance stats'. For a batch operation tool, this leaves room for improvement in contextual understanding.
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?
The input schema has 0% description coverage, so the description must compensate. It provides a clear example of the JSON format for 'law_article_pairs', explaining the structure with law-article pairs. This adds meaningful semantics beyond the bare schema, though it doesn't detail all possible values or constraints. With only one parameter, this is sufficient for baseline understanding.
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: 'Batch find multiple law articles efficiently' specifies the verb ('find'), resource ('law articles'), and scope ('batch', 'multiple'). It distinguishes from siblings like 'find_law_article' (singular) and 'search_laws' (different operation). However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.
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 batch operations versus single lookups (contrasting with 'find_law_article'), but doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_laws' or 'search_laws_by_keyword'. No when-not-to-use instructions or prerequisites are mentioned, leaving usage context partially implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
clear_cacheB
Clear specified cache or all caches
Args:
cache_type: Cache type to clear ("all", "law_lookup", "law_content", "article")
ctx: FastMCP context for logging
Returns:
Dict with clear operation results
| Name | Required | Description | Default |
|---|---|---|---|
| cache_type | No | all |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool clears caches, implying a destructive mutation, but lacks details on permissions required, whether it's reversible, rate limits, or logging behavior (though 'ctx' parameter hints at logging). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
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 appropriately sized and front-loaded, starting with the core action. The 'Args' and 'Returns' sections add structure, but the 'ctx' parameter explanation is minimal ('FastMCP context for logging'), and the return value description ('Dict with clear operation results') is vague. Overall, it's efficient with minor room for improvement in detail.
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 complexity (destructive mutation with 1 parameter) and lack of annotations/output schema, the description is moderately complete. It covers the purpose and parameters but misses behavioral details like side effects or error handling. For a cache-clearing tool, this is adequate but leaves gaps in understanding full implications, scoring as minimum viable with clear improvements needed.
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?
The description adds meaningful context beyond the input schema. The schema has 0% description coverage, listing only 'cache_type' with a default. The description explains 'cache_type' as 'Cache type to clear' with enumerated values ('all', 'law_lookup', 'law_content', 'article'), clarifying its purpose and options. This compensates well for the low schema coverage, though it doesn't detail the 'ctx' parameter beyond 'FastMCP context for logging'.
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 with the verb 'clear' and resource 'cache', specifying it can clear 'specified cache or all caches'. It distinguishes from sibling tools like 'get_cache_stats' (which reads) and 'prefetch_common_laws' (which populates). However, it doesn't explicitly differentiate from all siblings, such as 'batch_find_articles' which might involve caching indirectly, keeping it from a perfect score.
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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., when caches need clearing), exclusions (e.g., avoid during high traffic), or compare to siblings like 'get_cache_stats' for monitoring. Usage is implied only by the action 'clear', with no explicit context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_law_articleA
Find a specific article in Japanese law (ULTRA SMART & FAST)
Supports 16+ major laws with direct mapping for instant access.
Handles complex patterns like 条の2, 項, 号 automatically.
Args:
law_name: Law name (e.g., "民法", "会社法", "憲法")
article_number: Article number (e.g., "192", "325条の3", "第9条第2項")
ctx: FastMCP context for logging and progress reporting
Returns:
Dict with found article content and legal analysis metadata
| Name | Required | Description | Default |
|---|---|---|---|
| law_name | Yes | ||
| article_number | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions being 'ULTRA SMART & FAST' and handling complex patterns automatically, which adds useful context about performance and functionality. However, it lacks details on error handling, rate limits, or authentication needs, leaving gaps for a tool with no annotation coverage.
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 well-structured and front-loaded with the core purpose, followed by key features and parameter details. Every sentence adds value, such as specifying law support and pattern handling, with no redundant information, making it efficient and easy to parse.
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 complexity (handling Japanese legal articles with automatic pattern parsing) and no annotations or output schema, the description is adequate but incomplete. It covers the purpose and parameters well but lacks details on return values (only mentions a dict with content and metadata without specifics), error cases, or performance limitations, which could hinder agent usage.
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?
The description provides clear examples for both parameters (law_name and article_number), such as '民法' for law_name and '192' or '325条の3' for article_number, which adds meaningful context beyond the schema's 0% coverage. This compensates well for the lack of schema descriptions, though it doesn't fully explain all possible formats or constraints.
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 as finding a specific article in Japanese law, specifying it's 'ULTRA SMART & FAST' with support for 16+ major laws and automatic handling of complex patterns like 条の2, 項, 号. This distinguishes it from sibling tools like 'search_laws' or 'get_law_content' by focusing on precise article retrieval rather than broader searches or content fetching.
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 context by mentioning support for 16+ major laws and automatic pattern handling, which suggests it's for precise article lookup. However, it doesn't explicitly state when to use this tool versus alternatives like 'batch_find_articles' for multiple articles or 'search_laws' for broader queries, leaving some ambiguity in sibling tool differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cache_statsB
Get current cache statistics and performance metrics
Args:
ctx: FastMCP context for logging
Returns:
Dict with detailed cache statistics
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While it states the tool retrieves statistics (implying a read-only operation), it doesn't clarify important behavioral aspects such as whether this requires special permissions, what specific metrics are included, whether the data is real-time or cached, or if there are rate limits. The description is too vague about the actual behavior.
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 appropriately concise with three brief sentences that cover purpose, arguments, and return value. It's front-loaded with the main purpose first, and there's no unnecessary verbosity. However, the structure could be slightly improved by integrating the argument/return information more seamlessly rather than as separate labeled sections.
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 that there are no annotations and no output schema, the description should provide more complete context for a statistics-retrieval tool. It mentions returning a 'Dict with detailed cache statistics' but doesn't specify what those statistics include (e.g., hit rates, memory usage, eviction counts) or the format/structure. For a tool with zero parameters but potentially complex return data, this leaves significant gaps.
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?
The tool has zero parameters, and the input schema has 100% description coverage (though empty). The description correctly notes there are no parameters beyond the context argument, which is appropriate. Since there are no parameters to document, the description doesn't need to compensate for any gaps, earning a baseline 4.
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 with a specific verb ('Get') and resource ('current cache statistics and performance metrics'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'clear_cache' or explain how it differs from other monitoring/statistics tools that might exist.
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 provides no guidance on when to use this tool versus alternatives. There's no mention of when this tool is appropriate (e.g., for monitoring cache health, troubleshooting performance issues) or when other tools like 'clear_cache' or 'prefetch_common_laws' might be more suitable. The agent receives no contextual usage instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_law_contentA
Get law content (optimized per API spec with size limits)
Args:
law_id: Law ID
law_num: Law number
response_format: "json" or "xml"
elm: Element to retrieve (currently disabled due to API 400 errors)
ctx: FastMCP context for logging
Returns:
Dict with law content. For large laws (>800KB), returns summary with recommendation to use find_law_article for specific articles.
Note:
- elm parameter is currently disabled due to e-Gov API 400 errors
- Large laws like Company Law (会社法) will return a summary instead of full text
- Use find_law_article tool for specific article searches in large laws
| Name | Required | Description | Default |
|---|---|---|---|
| law_id | No | ||
| law_num | No | ||
| response_format | No | json | |
| elm | 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 and does well: it discloses API limitations ('elm parameter is currently disabled due to e-Gov API 400 errors'), size constraints ('optimized per API spec with size limits'), and behavioral specifics for large laws ('returns summary with recommendation to use find_law_article'). It doesn't mention authentication or rate limits, but covers key operational traits.
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 well-structured with clear sections (Args, Returns, Note) and front-loads the purpose. Some sentences could be tighter (e.g., 'optimized per API spec with size limits' is vague), but overall it's efficient with no redundant information.
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 4 parameters with 0% schema coverage and no output schema, the description does a good job explaining inputs, outputs, and behavioral constraints. It covers the return format for both normal and large laws, and mentions sibling tools. It could benefit from more detail on error handling or authentication, but is largely complete for the tool's complexity.
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 0%, so the description must compensate. It explains all 4 parameters in the Args section, adds context about 'elm' being disabled, and clarifies 'response_format' options. However, it doesn't fully explain the relationship between 'law_id' and 'law_num', or provide examples, leaving some ambiguity.
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 'Get law content' with the verb 'Get' and resource 'law content', and specifies it's 'optimized per API spec with size limits'. However, it doesn't explicitly differentiate from sibling tools like 'find_law_article' or 'search_laws' in the purpose statement itself, though it mentions them later.
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 provides explicit guidance on when to use alternatives: it states 'Use find_law_article tool for specific article searches in large laws' in the Note section, and implies this tool is for general law content retrieval. This directly helps the agent choose between this tool and its siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
prefetch_common_lawsC
Prefetch commonly accessed laws for better performance
Args:
ctx: FastMCP context for logging
Returns:
Dict with prefetch results and cache status
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states it 'prefetches for better performance', without disclosing behavioral traits like whether it's idempotent, its impact on cache state, error handling, or rate limits. It mentions 'cache status' in returns but doesn't explain what that entails operationally.
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 appropriately sized with three brief sections (purpose, args, returns), front-loaded with the main function. However, the 'Args' and 'Returns' sections add little beyond what's implied, slightly reducing efficiency.
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 no annotations and no output schema, the description is incomplete for a tool that likely involves caching behavior. It fails to explain what 'prefetch' does (e.g., loads laws into cache), what 'commonly accessed' means, or the structure of the returned dict, leaving significant gaps in understanding.
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?
The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds minimal value by noting 'ctx: FastMCP context for logging', which is redundant but doesn't detract, warranting a baseline score above minimum.
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 states the tool 'prefetches commonly accessed laws for better performance', which provides a vague purpose without specifying what 'prefetch' means operationally or how it differs from sibling tools like 'get_law_content' or 'search_laws'. It mentions a resource ('laws') but lacks specificity about scope or mechanism.
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 versus alternatives like 'get_cache_stats' or 'clear_cache'. The description implies a performance optimization context but doesn't specify prerequisites, timing, or exclusions, leaving usage unclear relative to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_lawsB
Search Japanese laws with smart filtering
Args:
law_title: Law title (partial match)
law_type: Law type (Act, CabinetOrder, etc.)
law_num: Law number (partial match)
limit: Maximum results (1-500)
offset: Starting position
ctx: FastMCP context for logging
Returns:
Dict with search results
| Name | Required | Description | Default |
|---|---|---|---|
| law_title | No | ||
| law_type | No | ||
| law_num | No | ||
| limit | No | ||
| offset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'smart filtering' but doesn't explain what this means operationally. It doesn't describe authentication requirements, rate limits, error conditions, or what the 'Dict with search results' actually contains. The mention of 'ctx: FastMCP context for logging' in the Args section is behavioral information, but this isn't part of the actual input 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?
The description is well-structured with clear sections (Args, Returns) and uses bullet-like formatting. The opening sentence establishes purpose, followed by parameter explanations. However, the inclusion of 'ctx: FastMCP context for logging' in Args is confusing since this parameter doesn't exist in the actual schema, creating some inefficiency.
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?
For a search tool with 5 parameters, 0% schema coverage, no annotations, and no output schema, the description does a reasonable job explaining parameters but leaves significant gaps. It doesn't explain the return format beyond 'Dict with search results', doesn't mention error conditions or rate limits, and provides no guidance on when to use versus sibling search tools.
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?
With 0% schema description coverage, the description must compensate, and it does so effectively by listing all 5 parameters with brief explanations. It clarifies that law_title and law_num support 'partial match', law_type includes examples like 'Act, CabinetOrder, etc.', and limit has a range '1-500'. This adds significant value beyond the bare 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?
The description clearly states the tool's purpose: 'Search Japanese laws with smart filtering' - a specific verb ('Search') and resource ('Japanese laws') with a qualifier ('smart filtering'). However, it doesn't differentiate from sibling tools like 'search_laws_by_keyword' or 'find_law_article', which appears to be a similar search function.
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 provides no guidance on when to use this tool versus alternatives. With multiple search-related sibling tools (search_laws_by_keyword, find_law_article, batch_find_articles), there's no indication of when this specific search_laws tool is appropriate versus those other options.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_laws_by_keywordB
Full-text keyword search in Japanese laws
Args:
keyword: Search keyword (required)
law_type: Law type filter (optional)
limit: Maximum results (1-20)
ctx: FastMCP context for logging
Returns:
Dict with search results
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| law_type | No | ||
| limit | 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 of behavioral disclosure. It mentions logging via 'ctx' but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication needs, or what happens with invalid inputs. For a search tool with zero annotation coverage, this is insufficient.
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 appropriately sized and front-loaded, starting with the core purpose followed by structured parameter and return details. Every sentence adds value, with no wasted words, though minor improvements in flow could make it slightly more polished.
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 moderate complexity (3 parameters, no output schema, no annotations), the description covers the basic purpose and parameters adequately but lacks details on behavioral traits, output format beyond 'Dict with search results,' and differentiation from sibling tools. It's minimally viable but has clear gaps in completeness.
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?
The description adds significant value beyond the input schema, which has 0% schema description coverage. It explains each parameter's purpose (e.g., 'keyword: Search keyword (required)'), clarifies optional vs. required, and provides context like the limit range (1-20) and logging use for 'ctx.' This compensates well for the schema's lack of descriptions.
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 performs 'Full-text keyword search in Japanese laws,' which specifies the verb (search), resource (Japanese laws), and scope (full-text keyword). However, it doesn't explicitly distinguish this from the sibling tool 'search_laws,' which might have overlapping functionality, preventing a perfect score.
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 provides no guidance on when to use this tool versus alternatives like 'search_laws' or 'find_law_article.' It mentions parameters but doesn't explain the context or prerequisites for using this search method, leaving the agent without clear usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have distinct purposes, but there is some overlap between search_laws and search_laws_by_keyword, which could cause confusion about when to use each. The batch_find_articles and find_law_article tools also serve similar functions but are differentiated by batch vs. single operations, which is reasonably clear.
All tool names follow a consistent snake_case pattern with clear verb_noun structure (e.g., find_law_article, get_cache_stats, search_laws). This consistency makes the toolset predictable and easy to navigate.
With 8 tools, the server is well-scoped for its domain of Japanese law lookup and search. Each tool has a clear role, covering operations like searching, fetching, caching, and batch processing without being overwhelming.
The toolset provides strong coverage for law lookup and search, including single and batch article retrieval, full-text search, and caching utilities. A minor gap is the lack of update or delete operations, but this is reasonable given the domain of static law data.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Japan Law MCP — Japanese national laws & ordinances via the e-Gov Law API.
Resolve, search and verify legal citations against the official sources, with provenance.
LawOracle — 20 legal AI tools: case law search, contracts, EU regulations, citation graph.
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
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.32,53048MIT
- AlicenseAqualityBmaintenanceEnables LLMs to search and retrieve Japanese laws from the e-Gov API v2, including keyword search, article fetching, table of contents, and revision history.7452MIT
- 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.16MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for searching and retrieving Japanese laws from the e-Gov API, enabling natural language queries for legal information.11MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryoooo/e-gov-law-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server