Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

get_prefecture_data

Retrieve prefecture codes and names from Japan's MLIT Data Platform, including options for short names, hiragana, and romaji fields as needed.

Instructions

都道府県名・都道府県コード一覧を取得する。

            使い方:
            - 引数なしで47都道府県の一覧を取得(コード/名称)。
            - 軽量にコードと正式名称のみ取得、または必要に応じて name_short / hiragana / romaji などをクライアント側でフィールド選択。

            例:
            - コードと名称だけ取得:
            (引数なしで呼び出し)

            - かな・ローマ字も含めて取得(クライアントのフィールド指定例):
            prefecture { code_as_string name hiragana romaji }

            注意:
            - GraphQL定義: `prefecture: [PrefectureClass]`。パラメータはありません(常に全都道府県を返します)。
            - 主なフィールド: code(数値), code_as_string(2桁文字列), name(正式名), name_short, hiragana, romaji, used_from / used_until。
            - 公式コードは2桁(先頭ゼロ付き)。アプリで文字列コードが必要な場合は `code_as_string` を利用してください。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool 'get_prefecture_data' handler in server.py calls client.get_prefectures()
    elif name == "get_prefecture_data":
        data = await client.get_prefectures()
  • MLITClient.get_prefectures() method, which performs the actual GraphQL API call to fetch prefectures.
    async def get_prefectures(self) -> Dict[str, Any]:
        q = """
        query {
          prefecture {
            code
            name
          }
        }
        """.strip()
        return await self.post_query(q)
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the tool always returns all prefectures (常に全都道府県を返します), explains the GraphQL return structure, details available fields (code_as_string, hiragana, romaji, etc.), and notes data format specifics (2-digit codes with leading zeros).

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?

Well-structured with clear sections (使い方, 例, 注意). Information is front-loaded with the core purpose first. Slightly verbose in the GraphQL field examples, but remains readable and purposeful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter tool, the description comprehensively compensates for the missing output schema by detailing all return fields, their data types (string vs number), and semantic meaning (official codes vs short names), providing sufficient context for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 0 parameters with 100% coverage (baseline 4). The description explicitly confirms there are no parameters (パラメータはありません) and explains the implication (always returns all prefectures), which validates the empty schema design.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it retrieves the list of prefecture names and codes (都道府県名・都道府県コード一覧を取得する). It specifically mentions the 47 prefectures (47都道府県), distinguishing it from generic sibling tools like get_data or search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear usage instructions (使い方) explaining no arguments returns all 47 prefectures and mentions client-side field selection. However, it lacks explicit guidance on when to use this versus generic alternatives like get_data or search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/kkawailab/kklab-mlit-dpf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server