Skip to main content
Glama
ryoooo

e-Gov Law MCP Server

by ryoooo

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
EGOV_API_URLNoThe e-Gov API URLhttps://laws.e-gov.go.jp/api/2
EGOV_API_TOKENNoe-Gov API token (usually not required)
LAW_CONFIG_PATHNoPath to the law configuration fileconfig/laws.yaml
MCP_SERVER_NAMENoThe MCP server namee-Gov Law Server v2

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
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
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
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
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
batch_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
prefetch_common_lawsC
Prefetch commonly accessed laws for better performance

Args:
    ctx: FastMCP context for logging
    
Returns:
    Dict with prefetch results and cache status
get_cache_statsB
Get current cache statistics and performance metrics

Args:
    ctx: FastMCP context for logging
    
Returns:
    Dict with detailed cache statistics
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

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
get_api_infoe-Gov Law API v2 information
get_law_typesSupported Japanese law types

TDQS

A3.5/5.0

Scored across 8 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues