Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

get_mesh

Retrieve specific geographic mesh data from Japan's MLIT Data Platform by providing dataset, data, mesh IDs, and mesh code to access detailed location-based information.

Instructions

メッシュに含まれるデータを取得する。

            使い方:
            - 事前に `search` API で対象データを特定し、レスポンスの `dataset_id`(=dataSetID)、`id`(=dataID)、
            および `meshes[].id`(=meshID)を取得します。その上で、本APIに `meshCode`(メッシュコード)を指定して該当メッシュのオブジェクトを取得します。
            - `meshCode` は任意の次元(例: 250m など)のメッシュコードを指定可能。該当がなければ `null` が返ります。

            例:
            - 人口5次メッシュ(250m)の一枚を取得:
            dataset_id="dpf_population_data",
            data_id="8fb65cb6-a7e3-4b15-bf17-1c71be572a9f",
            mesh_id="national_sensus_250m_r2",
            mesh_code="5339452932"

            - 事前に `search` で必要パラメータを取得:
            term="人口及び世帯" → 結果の `dataset_id`, `id`, `meshes[].id` を本APIに転用

            注意:
            - GraphQL定義は `mesh(dataSetID:String!, dataID:String!, meshID:String!, meshCode:String!): JSONObject`。
            返却はJSONオブジェクトで、メッシュコードや指標(例: 総人口 等)が含まれます。該当しない場合は `null`。:contentReference[oaicite:1]{index=1}
            - `meshCode` の粒度は自由ですが、データ側に該当レコードが存在しないと取得できません(空振り時は `null`)。:contentReference[oaicite:2]{index=2}
            - 必要な `meshID` は `search` レスポンスの `meshes` 配列から選びます(例: "national_sensus_250m_r2")。:contentReference[oaicite:3]{index=3}
            - 利用にはMLIT DPFのGraphQLエンドポイントとAPIキーが必要です。:contentReference[oaicite:4]{index=4}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idYesデータセットID
data_idYesデータID
mesh_idYesメッシュID
mesh_codeYesメッシュコード(標準地域メッシュコード)

Implementation Reference

  • The MCP tool 'get_mesh' handler logic in 'src/server.py' which parses input arguments and calls the 'MLITClient' method.
    elif name == "get_mesh":
        p = MeshParams.model_validate(arguments)
        data = await client.get_mesh(
            dataset_id=p.dataset_id,
            data_id=p.data_id,
            mesh_id=p.mesh_id,
            mesh_code=p.mesh_code,
        )
  • The implementation of the 'get_mesh' tool logic in the 'MLITClient' class which constructs and executes the GraphQL query.
    async def get_mesh(self, *, dataset_id: str, data_id: str, mesh_id: str, mesh_code: str) -> Dict[str, Any]:
        q = self.build_mesh(dataset_id=dataset_id, data_id=data_id, mesh_id=mesh_id, mesh_code=mesh_code)
        return await self.post_query(q)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses critical behavioral traits: requires MLIT DPF GraphQL endpoint and API key, returns `null` when mesh not found (empty result behavior), and returns a JSON object containing mesh codes and indicators. Minor gap: no rate limit or error handling details mentioned.

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 (Usage, Examples, Notes). Information is front-loaded with the prerequisite workflow. Minor deductions for `:contentReference` artifacts (likely documentation import noise) and slight repetition regarding null return behavior, but overall efficiently organized.

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

Completeness4/5

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

No output schema exists, and the description adequately compensates by specifying the return type (JSON object with mesh codes/indicators) and null handling. Complex prerequisite workflow is fully documented. Minor gap: could elaborate on the specific structure of the returned JSON object.

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?

Schema coverage is 100%, establishing baseline 3. The description adds significant value by explaining where each ID originates (`dataset_id` from search response's `dataset_id`, `data_id` from `id`, etc.) and noting that `mesh_code` accepts arbitrary dimensions (e.g., 250m). This semantic context exceeds the schema's basic type definitions.

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?

The description opens with a clear, specific verb phrase 'メッシュに含まれるデータを取得する' (Retrieve data contained in the mesh). It effectively distinguishes from siblings like `get_data` or `get_all_data` by emphasizing the mesh-specific retrieval workflow and prerequisite `search` call required to obtain the specific IDs.

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

Usage Guidelines5/5

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

Explicit '使い方' (Usage) section provides clear prerequisites: must call `search` API first to obtain `dataset_id`, `data_id`, and `mesh_id` before invoking this tool. It also specifies the exact source of each parameter in the search response, creating an unambiguous workflow.

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