get_data_catalog
Retrieve detailed information about data catalogs and datasets from Japan's MLIT Data Platform, enabling users to access metadata, filter by specific catalogs, and optionally include dataset listings.
Instructions
データカタログ・データセットの詳細情報を取得する。
使い方:
- すべてのカタログの詳細を取得(重い): ids を指定しない(内部的に IDs=null 相当)、include_datasets=True
- 特定カタログだけ取得(推奨): ids=["cals","rsdb"] のように配列で指定
- 軽量にID/タイトル等だけ取得: minimal=True
- データセット一覧や件数も取得: include_datasets=True(データセットのメタデータ定義・件数が取得可能)
例:
- 全カタログのID/タイトルのみ(軽量):
minimal=True, include_datasets=False
- 特定カタログ(cals, rsdb)の詳細 + データセット一覧:
ids=["cals","rsdb"], minimal=False, include_datasets=True
- 単一カタログのメタ情報だけ(datasets不要):
ids=["mlit_plateau"], minimal=False, include_datasets=False
注意:
- 公式仕様では `dataCatalog(IDs: [String])` で、IDs に null を渡すと全カタログが返ります。IDを指定すると対象のみ取得されます。
- `include_datasets=True` の場合、各カタログ配下の `datasets` 情報(メタデータ定義、データ件数など)も取得します。大量になるため必要に応じてオフにしてください。
- `minimal=True` は主要フィールド中心の軽量レスポンスです。詳細が必要な場合は False にしてください。
- 返るフィールドは `DataCatalogClass` に準拠します(title, description, publisher, modified など多数を含み、datasets も持ちます)。Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | カタログIDの配列。nullの場合は全カタログを取得 | |
| minimal | No | 最小限の情報のみ返す | |
| include_datasets | No | 配下のデータセット情報も含める |
Implementation Reference
- src/server.py:1315-1325 (handler)Tool handler for "get_data_catalog" in server.py, which calls the corresponding method on the MLITClient.
elif name == "get_data_catalog": ids = arguments.get("ids") if ids is not None and not isinstance(ids, list): raise ValueError("ids must be an array of strings") minimal = arguments.get("minimal", False) include_datasets = arguments.get("include_datasets", True) data = await client.get_data_catalog( ids=ids, minimal=minimal, include_datasets=include_datasets, ) - src/client.py:767-776 (handler)Implementation of the "get_data_catalog" tool logic in MLITClient.
async def get_data_catalog( self, *, ids: Optional[List[str]] = None, minimal: bool = False, include_datasets: bool = True, ) -> Dict[str, Any]: fields = "id title" if minimal else "id title" q = self.build_data_catalog(ids=ids, fields=fields, include_datasets=include_datasets) return await self.post_query(q)