japan-law-mcp

v0.2.0
japan-law-mcp Checked 16 hours ago Published 3 months ago

MCP server for Japan's e-Gov 法令API v2 — search, cite and quote Japanese statutes by article, including 附則/別表/号 and point-in-time (asof) lookups.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_laws Search laws by title or number

Search Japanese laws by TITLE, number or category — not by body text. Use this to find a law and its ``law_id``; use ``search_laws_by_keyword`` to search the text inside laws.

ParameterTypeDescription
asofstringYYYY-MM-DD — return each law as it stood on that date.
category_cdstringe-Gov subject category code(s), comma-separated (e.g. "27" 労働).
law_numstringPart of the 法令番号, e.g. "平成十五年法律".
law_titlestringPart of the law name, e.g. "個人情報" or "民法".
law_typestringOne of Act, CabinetOrder, MinisterialOrdinance, Rule, Constitution. Defaults to "Act"; pass "" to search all types.
limitintegerMaximum laws to return (default 10).
offsetintegerNumber of results to skip, for pagination (default 0).
orderstringSort key, e.g. "-revision_info.amendment_promulgate_date" for most-recently-amended first.
promulgation_date_fromstringOnly laws promulgated on/after this YYYY-MM-DD.
promulgation_date_tostringOnly laws promulgated on/before this YYYY-MM-DD.

search_laws_by_keyword Full-text search across all laws

Full-text search across the BODY of every Japanese law. Use this when you don't know which law says something; use ``search_laws`` when you know the law's name.

ParameterTypeDescription
keyword *stringPhrase to find in law text. Supports the e-Gov search syntax, including wildcards (``第*条``) and AND/OR/NOT operators.
asofstringYYYY-MM-DD — search the laws as they stood on that date.
category_cdstringe-Gov subject category code(s), comma-separated.
law_typestringOptional type filter, e.g. "Act" (comma-separated for several).
limitintegerCap on the total number of matched sentences returned across all laws (default 50, e-Gov max 1000) — not a cap on the number of laws. Note: the e-Gov API returns no results when this is smaller than…
offsetintegerResult offset for pagination (default 0); pass back ``next_offset``.
sentence_text_sizeintegerCharacters of context per matched sentence (default 100).
sentences_limitintegerMax matched sentences kept per law (default 5).

find_law_article Find one article of a law

Find a specific article within a Japanese law. Resolves common law names and abbreviations directly (e.g. "民法", "労基法"), then asks e-Gov for that one article via its element path — the whole statute is never downloaded.

ParameterTypeDescription
article *stringArticle number. Accepts plain numbers ("192"), branch articles ("325条の3"), kanji ("第七百九条"), a paragraph ("第9条第2項") and an item ("第24条第1項第4号").
law_name *stringLaw name or abbreviation, e.g. "民法", "会社法", "道交法".
asofstringYYYY-MM-DD — the law as it stood on that date.
provisionstring"main" for 本則 (default) or "suppl" for 附則 (supplementary provisions). 附則 articles reuse main-body numbers, so this matters.
revision_idstringAn exact ``law_revision_id`` from ``get_law_revisions``; overrides name resolution and ``asof``.

get_law_element Fetch any element of a law (別表・附則・目次)

Fetch one element of a law by its element path — the raw ``elm`` escape hatch.

ParameterTypeDescription
elm *stringElement path. Examples: ``AppdxTable[1]`` (別表第一), ``SupplProvision[1]`` (附則), ``Preamble[1]`` (前文), ``TOC[1]`` (目次), ``MainProvision-Article_24`` (第24条), ``MainProvision-Articl…
law_id *stringA ``law_id``, 法令番号 or law name (e.g. "326CO0000000319").
asofstringYYYY-MM-DD — the law as it stood on that date.
offsetintegerCharacter offset into the cleaned text, for paging long elements.
revision_idstringAn exact ``law_revision_id``; overrides ``law_id``/``asof``.

get_law_revisions List a law's amendment history

List every revision of a law, newest first — including 未施行 amendments. Use this to answer "has this law been amended?", "what changes are pending?" and "when does the amendment take effect?", and to get a ``law_revision_id`` for an exact version (pass it to ``find_law_article``/``get_law_element``).

ParameterTypeDescription
law_name_or_id *stringLaw name, abbreviation, ``law_id`` or 法令番号.
unenforced_onlybooleanWhen True, return only revisions whose ``current_revision_status`` is "UnEnforced" (未施行 — promulgated but not yet in force).

get_law_content Law metadata and table of contents

Fetch a law's metadata, table of contents, and optionally its full text.

ParameterTypeDescription
law_id *stringA ``law_id`` or 法令番号 from ``search_laws`` (e.g. "129AC0000000089" or "明治二十九年法律第八十九号").
asofstringYYYY-MM-DD — the law as it stood on that date.
full_textbooleanWhen True, include the full plain text of the law. Large laws are written to ``data/`` instead of returned inline (use a preview + ``read_saved_law``, or ``find_law_article`` for one article).
savebooleanWhen True, always write the full text to ``data/{law_num}.txt``.

fetch Fetch (Deep Research)

Fetch the text behind a ``search`` result id (Deep Research convention). ``id`` is either a bare ``law_id`` (returns metadata, table of contents and the opening of the law) or ``"{law_id}::{elm_path}"`` (returns that one provision's text).

ParameterTypeDescription
id *string

get_english_law Fetch a law's official English translation

Fetch the English translation of a Japanese law, whole or by article. Source is the Ministry of Justice's Japanese Law Translation database — unofficial reference translations that often lag the Japanese text. The result states which amendment the translation reflects and warns when e-Gov shows a newer amendment in force. Use this when the user needs Japanese law *in English*; use ``find_law_article`` for the authoritative Japanese text.

ParameterTypeDescription
law_name *stringJapanese law name, abbreviation or 法令番号 — "労働基準法", "労基法", "昭和二十二年法律第四十九号". English titles work too.
articlestringArticle to return, e.g. "32", "第32条", "32条の2" (条の枝番 supported). Empty returns the table of contents and structure summary instead of body text.
offsetintegerCharacter offset into the returned text, for paging.

search_english_laws Search translated laws (English catalogue)

Search the Japanese Law Translation catalogue by law title. Accepts English ("labor standards", "immigration") or Japanese ("労働基準法") keywords and returns the ``jlt_id`` plus the titles needed to pick a law, which ``get_english_law`` then fetches.

ParameterTypeDescription
query *stringTitle keyword(s), English or Japanese.
include_untranslatedbooleanAlso list laws whose titles are indexed but which have no translation yet — useful for confirming that a law genuinely has not been translated.
limitintegerMaximum matches to return (default 20).

compare_law_revisions Compare two versions of a law (新旧対照)

Diff two versions of a Japanese law (新旧対照), article by article. Answers "what did the 2019 reform actually change?" and "what exactly changed in 第36条?". Both versions' 本則 are fetched from e-Gov and their articles compared by number, so each provision comes back as added, deleted, modified or unchanged. 附則 (supplementary provisions) are out of scope.

ParameterTypeDescription
law_name_or_id *stringLaw name, abbreviation, ``law_id`` or 法令番号 (e.g. "労働基準法", "労基法", "322AC0000000049").
old *stringThe earlier version. Accepts a ``law_revision_id`` from ``get_law_revisions``, a date in YYYY-MM-DD form (the law as it stood then — e-Gov only serves dates from 2017-04-01 onwards, so use a ``law_r…
articlestringRestrict the comparison to one article, e.g. "36", "第36条" or "24条の2". Returns that article's FULL old text, new text and diff — use it to drill into anything the summary flags.
max_articlesintegerMaximum changed articles detailed in one call (default 20).
newstringThe later version, same forms as ``old``. Defaults to "current".
offsetintegerNumber of changed articles to skip, for paging (default 0).
scopestring"changed" (default) lists only added/deleted/modified articles; "all" additionally returns the numbers of unchanged articles.

get_law_definitions Defined terms in a law (定義語)

Find the terms a Japanese law defines (定義語) and where it defines them. Japanese statutes bind their own vocabulary: 「この法律において「労働者」とは …をいう」 in a (定義) article, a 各号 list where each 号 defines one term, or a parenthetical 「(以下「特定技能雇用契約」という。)」 buried in the article that first uses the term. Read an article without these and you will read it wrong — 「労働者」 does not mean the same thing in every law.

ParameterTypeDescription
law_name_or_id *stringLaw name, abbreviation, ``law_id`` or 法令番号 (e.g. "労働契約法", "労基法", "322AC0000000049").
termstringOptional filter — return only definitions whose term contains this string. The whole law is scanned either way, so a filtered call and an unfiltered one see the same candidates.

get_article_references Outbound references of an article (参照・準用)

List every provision one article of a Japanese law points at. Extracts absolute internal references (第三十六条第一項第二号, ranges 第三十二条から第三十二条の五まで, lists 第三十三条及び第三十六条), relative ones (前条・次条・前二項・同条), references to other laws by name plus 法令番号, and 準用 clauses ("第○条の規定は、…について準用する", with a flag when a 読み替え table is attached).

ParameterTypeDescription
article *stringArticle number in any form ``find_law_article`` accepts — "37", "第三十七条", "第32条の2".
law_name_or_id *stringLaw name, abbreviation, ``law_id`` or 法令番号.
resolve_relativebooleanWhen True (default), 前条/次条/前項/前二項 are converted to absolute numbers using the article's position in the statute, and the reference is marked ``resolved_from_relative``. 同条/同項…

find_where_cited Where an article is cited (same law)

Find which other articles of the SAME law cite a given article. The reverse of ``get_article_references``: scan every 本則 article for citations of the target and report the citing articles with the sentence each citation sits in. Useful for "what turns on 第三十六条?" — the answer is usually spread across articles that never appear in the target's own text. 枝番 are matched exactly: a search for 第二十四条 will not report 第二十四条の二. Kanji and ASCII numbering are both matched, and a ``第二十条から第三十条まで`` span that covers the target is reported a…

ParameterTypeDescription
article *stringThe cited article — "36", "第三十六条", "第32条の2".
law_name_or_id *stringLaw name, abbreviation, ``law_id`` or 法令番号.
max_resultsintegerMaximum citing articles to return (default 25).