Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

search

Search Japan's MLIT Data Platform using keywords with options for phrase matching, result sorting, pagination, and field selection.

Instructions

キーワードを使って検索する。検索結果の並べ替えや取得件数を設定することも可能。

            使い方:
            - キーワード検索(同義語も対象): term="橋梁"
            - 完全一致で絞り込み: term="橋梁", phrase_match=True
            - ページング取得: first=0, size=50  ※APIの上限は一度に最大10,000件
            - 並べ替え: sort_attribute_name="DPF:updated_at", sort_order="dsc"(降順)/ "asc"(昇順)
            - 軽量レスポンス: minimal=True(主要フィールドのみ取得)

            例:
            - バス停を検索: term="バス停"
            - 橋梁を新しい更新順で取得: term="橋梁", sort_attribute_name="DPF:updated_at", sort_order="dsc"
            - ページ2相当を取得: term="道路", first=50, size=50

            注意:
            - API仕様上、term=""(空文字)でも検索は可能ですが、空間条件(矩形/円)やメタデータ条件を使った絞り込みは本ツールでは扱いません。
            空間検索は「search_by_location_rectangle / search_by_location_point_distance」、
            メタデータ検索は「search_by_attribute」を利用してください。
            - sort_order は "asc" または "dsc" を指定してください。
            - 大量件数を扱う場合はページング(first/size)を利用してください。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNo検索キーワード。属性フィルタ(prefecture_code等)のみで検索する場合は空文字列""を設定してください
firstNo検索結果の開始位置(オフセット)。ページネーションに使用
sizeNo取得件数(最大500)。大量データの場合はget_all_dataを使用してください
sort_attribute_nameNoソート属性名 (例: 'DPF:year', 'DPF:title')
sort_orderNoソート順序: 'asc'(昇順) または 'dsc'(降順)
phrase_matchNoフレーズマッチ。true=完全一致優先, false=部分一致
minimalNo最小限のフィールドのみ返す(id, title, lat, lon, dataset_id)

Implementation Reference

  • The "search" tool handler logic, which validates input parameters and calls `client.search_keyword`.
    if name == "search":
        p = SearchBase.model_validate(arguments)
        data = await client.search_keyword(
            term=p.term or "",
            first=p.first,
            size=p.size,
            phrase_match=p.phrase_match,
            sort_attribute_name=p.sort_attribute_name,
            sort_order=p.sort_order,
            fields=client._fields_min() if p.minimal else client._fields_basic(),
        )
  • src/server.py:51-110 (registration)
    The definition and registration of the "search" tool in the `handle_list_tools` function.
    types.Tool(
        name="search",
        description="""キーワードを使って検索する。検索結果の並べ替えや取得件数を設定することも可能。
    
            使い方:
            - キーワード検索(同義語も対象): term="橋梁"
            - 完全一致で絞り込み: term="橋梁", phrase_match=True
            - ページング取得: first=0, size=50  ※APIの上限は一度に最大10,000件
            - 並べ替え: sort_attribute_name="DPF:updated_at", sort_order="dsc"(降順)/ "asc"(昇順)
            - 軽量レスポンス: minimal=True(主要フィールドのみ取得)
    
            例:
            - バス停を検索: term="バス停"
            - 橋梁を新しい更新順で取得: term="橋梁", sort_attribute_name="DPF:updated_at", sort_order="dsc"
            - ページ2相当を取得: term="道路", first=50, size=50
    
            注意:
            - API仕様上、term=""(空文字)でも検索は可能ですが、空間条件(矩形/円)やメタデータ条件を使った絞り込みは本ツールでは扱いません。
            空間検索は「search_by_location_rectangle / search_by_location_point_distance」、
            メタデータ検索は「search_by_attribute」を利用してください。
            - sort_order は "asc" または "dsc" を指定してください。
            - 大量件数を扱う場合はページング(first/size)を利用してください。""",
        inputSchema={
            "type": "object",
            "properties": {
                "term": {
                    "type": "string",
                    "description": "検索キーワード。属性フィルタ(prefecture_code等)のみで検索する場合は空文字列\"\"を設定してください"
                },
                "first": {
                    "type": "integer",
                    "default": 0,
                    "description": "検索結果の開始位置(オフセット)。ページネーションに使用"
                },
                "size": {
                    "type": "integer",
                    "default": 50,
                    "description": "取得件数(最大500)。大量データの場合はget_all_dataを使用してください"
                },
                "sort_attribute_name": {
                    "type": "string",
                    "description": "ソート属性名 (例: 'DPF:year', 'DPF:title')"
                },
                "sort_order": {
                    "type": "string",
                    "description": "ソート順序: 'asc'(昇順) または 'dsc'(降順)"
                },
                "phrase_match": {
                    "type": "boolean",
                    "default": True,
                    "description": "フレーズマッチ。true=完全一致優先, false=部分一致"
                },
                "minimal": {
                    "type": "boolean",
                    "default": False,
                    "description": "最小限のフィールドのみ返す(id, title, lat, lon, dataset_id)"
                },
            },
        },
    ),
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 and discloses key behavioral traits: the 10,000-item API limit, that phrase_match controls synonym vs exact matching, and that minimal=True returns only main fields. It could be improved by explicitly stating the read-only nature or error handling patterns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Excellent structure with clearly delineated sections (使い方, 例, 注意). Every sentence serves a purpose—examples demonstrate parameter interactions, notes clarify boundaries, and formatting makes the 7-parameter configuration scannable. No redundancy despite the length.

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?

Given the 7 parameters, zero annotations, and no output schema, the description is remarkably complete. It covers all parameter interactions, API limits, and sibling tool references. A brief mention of the return value structure (implied only through minimal parameter description) would achieve a 5.

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?

While the schema has 100% coverage (baseline 3), the description adds significant value through concrete usage examples (e.g., term='橋梁', sort_attribute_name='DPF:updated_at'), explains the practical difference between phrase_match=true/false (synonyms vs exact), and clarifies the lightweight response behavior of the minimal flag.

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 action statement (キーワードを使って検索する) and immediately distinguishes this tool from its siblings by explicitly stating it does NOT handle spatial conditions or metadata filtering, directing users to search_by_location_rectangle, search_by_location_point_distance, and search_by_attribute instead.

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?

Provides explicit when-to-use and when-not-to-use guidance: it notes that empty string searches are possible but spatial/metadata filtering requires other tools. It also names specific alternatives and explains pagination requirements for large datasets ('APIの上限は一度に最大10,000件').

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