get_dataset
Retrieve statistical datasets from Japan's official government portal, enabling access to census data, economic indicators, and demographic information across 17 fields.
Instructions
データセットを参照する.
Args: dataset_id: 取得対象のデータセットID(省略時は利用可能一覧) start_position: データ取得開始位置 limit: 取得件数
Returns: データセット情報
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | No | ||
| start_position | No | ||
| limit | No |
Implementation Reference
- e_stats_mcp/tools/dataset.py:46-70 (handler)The async handler function implementing the 'get_dataset' tool logic. It constructs parameters for dataset_id, start_position, and limit, then calls _make_request to the e-Stat API 'json/refDataset' endpoint and returns the response.async def get_dataset( dataset_id: str | None = None, start_position: int | None = None, limit: int | None = None, ) -> dict: """データセットを参照する. Args: dataset_id: 取得対象のデータセットID(省略時は利用可能一覧) start_position: データ取得開始位置 limit: 取得件数 Returns: データセット情報 """ params: dict = {} if dataset_id: params["datasetId"] = dataset_id if start_position: params["startPosition"] = str(start_position) if limit: params["limit"] = str(limit) response = await _make_request("json/refDataset", params) return cast(dict[str, Any], response)
- e_stats_mcp/main.py:55-55 (registration)Registration of the 'get_dataset' tool using the FastMCP mcp.tool() decorator.mcp.tool()(get_dataset)
- e_stats_mcp/main.py:11-25 (registration)Import of the get_dataset function into main.py for registration.from e_stats_mcp.tools import ( get_data_catalog, get_data_catalog_csv, get_dataset, get_meta_info, get_meta_info_csv, get_stats_fields, get_stats_data, get_stats_data_bulk, get_stats_data_csv, get_stats_list, get_stats_list_csv, post_dataset, search_stats_by_keyword, )
- e_stats_mcp/tools/__init__.py:30-30 (registration)Export of get_dataset in tools/__init__.py __all__ list."get_dataset",
- e_stats_mcp/tools/dataset.py:8-9 (helper)Import of the _make_request helper used by the handler.from e_stats_mcp.tools.stats import _make_request