get_data
Retrieve detailed metadata and related fields for specific data entries from Japan's MLIT Data Platform using dataset and data IDs.
Instructions
データセットIDとデータIDを用いて、データの詳細情報を取得する。
使い方:
- 検索API(search)で拾った id を使って、対象データの詳細(title 以外の各種メタ情報や関連フィールド)を取得。
- すでに対象が確定している場合、検索よりも効率的に必要情報へアクセスできます。
例:
- 既知IDで詳細取得:
dataset_id="cals_construction", data_id="<searchで取得したid>"
- データセット内の特定データを直接参照:
dataset_id="mlit-001", data_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
注意:
- 引数は GraphQL の data(dataSetID:, dataID:) に対応しています。
- data_id は search の結果(DataClass.id)を使用してください。
- 存在しないIDを指定した場合、totalNumber=0 となり結果は返りません。
- 詳細項目は MLIT DPF のスキーマに依存します(必要な項目はクライアント側でフィールド選択推奨)。Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | データセットID | |
| data_id | Yes | データID |
Implementation Reference
- src/client.py:721-740 (handler)The implementation of the get_data tool, which queries the MLIT Data Platform for specific data details given a dataset_id and data_id.
async def get_data(self, dataset_id: str, data_id: str) -> Dict[str, Any]: q = f""" query {{ data(dataSetID: "{dataset_id}", dataID: "{data_id}") {{ totalNumber getDataResults {{ id title metadata files {{ id original_path }} hasThumbnail tileset {{ url altitude_offset_meters }} }} }} }} """.strip() return await self.post_query(q) - src/server.py:1308-1310 (handler)Handler in src/server.py that invokes the MLITClient's get_data method.
elif name == "get_data": p = GetDataParams.model_validate(arguments) data = await client.get_data(p.dataset_id, p.data_id) - src/schemas.py:58-60 (schema)Input parameter validation for the get_data tool.
class GetDataParams(BaseModel): dataset_id: str = Field(..., alias="dataset_id") data_id: str = Field(..., alias="data_id")