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"],
        },
    ),

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