Skip to main content
Glama
kkawailab

MLIT Data Platform MCP Server

by kkawailab

search_by_location_point_distance

Search MLIT Data Platform for infrastructure data within a specified radius from geographic coordinates. Combine location with optional keywords to find roads, bus stops, or other facilities near any point in Japan.

Instructions

指定した地点と半径によって作成される円形範囲と交差するデータを検索する。

            使い方:
            - 緯度(lat)、経度(lon)、距離(メートル単位)を指定して円形範囲を作成。
            - term(キーワード)を組み合わせることで空間+テキスト検索も可能。

            例:
            - 東京駅から半径500m以内のバス停を検索:
            term="バス停", location_lat=35.681236, location_lon=139.767125, location_distance=500

            - 半径5km以内の道路関連データ:
            term="道路", location_lat=35.68, location_lon=139.75, location_distance=5000

            - term="" で位置情報のみ検索:
            term="", location_lat=35.68, location_lon=139.75, location_distance=1000

            注意:
            - location_lat / location_lon / location_distance の3つは必須。
            - location_distance の単位はメートル。
            - WGS84座標系を使用。
            - phrase_match=Trueで完全一致検索。
            - 大きな半径を指定すると結果件数が増加するため、sizeで制御してください。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNo検索キーワード。位置のみで検索する場合は省略可能
firstNo検索結果の開始位置
sizeNo取得件数(最大500)
phrase_matchNoフレーズマッチモード
prefecture_codeNo都道府県コード。normalize_codesで正規化可能
location_latYes中心地点の緯度 (例: 35.6812 for 東京駅)
location_lonYes中心地点の経度 (例: 139.7671 for 東京駅)
location_distanceYes検索半径(メートル単位)。例: 1000 = 半径1km圏内

Implementation Reference

  • Handler logic for search_by_location_point_distance in src/server.py
    elif name == "search_by_location_point_distance":
        p = SearchByPoint.model_validate({
            "term": arguments.get("term"),
            "first": arguments.get("first", 0),
            "size": arguments.get("size", 50),
            "phrase_match": arguments.get("phrase_match", True),
            "prefecture_code": arguments.get("prefecture_code"),
            "point": {
                "lat": arguments["location_lat"],
                "lon": arguments["location_lon"],
                "distance": arguments["location_distance"],
            }
        })
        data = await client.search_by_point(
            p.point.lat, p.point.lon, p.point.distance,
            term=p.term or "",
            first=p.first,
            size=p.size,
            phrase_match=p.phrase_match,
        )
  • Client-side implementation of search_by_point which executes the query for search_by_location_point_distance tool.
    async def search_by_point(self, lat: float, lon: float, distance_m: float, **kw) -> Dict[str, Any]:
        loc = self.make_geodistance_filter(lat, lon, distance_m)
        q = self.build_search(location_filter=loc, **kw)
        return await self.post_query(q)
  • src/server.py:192-257 (registration)
    Tool registration for search_by_location_point_distance in src/server.py
    types.Tool(
        name="search_by_location_point_distance",
        description="""指定した地点と半径によって作成される円形範囲と交差するデータを検索する。
    
            使い方:
            - 緯度(lat)、経度(lon)、距離(メートル単位)を指定して円形範囲を作成。
            - term(キーワード)を組み合わせることで空間+テキスト検索も可能。
    
            例:
            - 東京駅から半径500m以内のバス停を検索:
            term="バス停", location_lat=35.681236, location_lon=139.767125, location_distance=500
    
            - 半径5km以内の道路関連データ:
            term="道路", location_lat=35.68, location_lon=139.75, location_distance=5000
    
            - term="" で位置情報のみ検索:
            term="", location_lat=35.68, location_lon=139.75, location_distance=1000
    
            注意:
            - location_lat / location_lon / location_distance の3つは必須。
            - location_distance の単位はメートル。
            - WGS84座標系を使用。
            - phrase_match=Trueで完全一致検索。
            - 大きな半径を指定すると結果件数が増加するため、sizeで制御してください。""",
        inputSchema={
            "type": "object",
            "properties": {
                "term": {
                    "type": "string",
                    "description": "検索キーワード。位置のみで検索する場合は省略可能"
                },
                "first": {
                    "type": "integer",
                    "default": 0,
                    "description": "検索結果の開始位置"
                },
                "size": {
                    "type": "integer",
                    "default": 50,
                    "description": "取得件数(最大500)"
                },
                "phrase_match": {
                    "type": "boolean",
                    "default": True,
                    "description": "フレーズマッチモード"
                },
                "prefecture_code": {
                    "type": "string",
                    "description": "都道府県コード。normalize_codesで正規化可能"
                },
                "location_lat": {
                    "type": "number",
                    "description": "中心地点の緯度 (例: 35.6812 for 東京駅)"
                },
                "location_lon": {
                    "type": "number",
                    "description": "中心地点の経度 (例: 139.7671 for 東京駅)"
                },
                "location_distance": {
                    "type": "number",
                    "description": "検索半径(メートル単位)。例: 1000 = 半径1km圏内"
                },
            },
            "required": ["location_lat", "location_lon", "location_distance"],
        },
    ),
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses WGS84 coordinate system, phrase_match exact-match behavior, and performance warning about large radii increasing result count. However, lacks disclosure of result sorting (distance vs relevance), error behavior for invalid coordinates, or rate limiting concerns.

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 clear visual separation: Purpose → Usage → Examples → Notes. Each section is dense with actionable information. Examples use consistent formatting (parameter=value) that mirrors actual API calls. No filler text; even the '注意' section provides specific constraints (3 required params, max results control).

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?

Comprehensive for input handling with 8 parameters fully contextualized. Covers coordinate system, pagination hints (size control), and search modes. However, given no output schema exists, the description should ideally characterize return values (e.g., 'returns list of spatial data records') rather than just stating 'search data'.

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

Parameters5/5

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

Despite 100% schema coverage (baseline 3), description adds substantial value through concrete examples with real coordinates (Tokyo Station 35.681236, 139.767125), clarifies empty string usage for term, and emphasizes the meter unit for distance. The examples effectively demonstrate parameter interaction patterns beyond individual field descriptions.

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 opens with a precise statement: '指定した地点と半径によって作成される円形範囲と交差するデータを検索する' (Search for data intersecting with the circular range created by specified point and radius). This provides specific verb (検索/search), resource (データ/data), and geometric scope (circular range) that clearly differentiates it from sibling rectangle-based and attribute-based search tools.

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

Usage Guidelines4/5

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

Provides excellent practical guidance through '使い方' (How to use) and three concrete examples showing spatial-only vs spatial+text search patterns. Explicitly notes that term can be empty for location-only searches. However, lacks explicit comparison to siblings (e.g., when to use search_by_location_rectangle vs this tool).

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