Skip to main content
Glama

get_stats_data_bulk

Retrieve multiple statistical datasets from Japan's official government statistics portal in a single request using table or dataset IDs.

Instructions

複数の統計表ID/データセットIDから統計データを一括取得する.

Input Schema

NameRequiredDescriptionDefault
stats_data_idsNo
dataset_idsNo
start_positionNo
limitNo

Input Schema (JSON Schema)

{ "properties": { "dataset_ids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null }, "limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null }, "start_position": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null }, "stats_data_ids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null } }, "type": "object" }

Implementation Reference

  • The main handler function for the get_stats_data_bulk tool. It constructs parameters from input lists of stats_data_ids or dataset_ids and makes a POST request to the e-Stat API endpoint 'json/getStatsDatas' using the internal _make_request helper.
    async def get_stats_data_bulk( stats_data_ids: list[str] | None = None, dataset_ids: list[str] | None = None, start_position: int | None = None, limit: int | None = None, ) -> dict: """複数の統計表ID/データセットIDから統計データを一括取得する.""" params: dict = {"lang": "J"} if stats_data_ids: params["statsDataId"] = ",".join(stats_data_ids) if dataset_ids: params["datasetId"] = ",".join(dataset_ids) if start_position: params["startPosition"] = str(start_position) if limit: params["limit"] = str(limit) # getStatsDatas は POST エンドポイントのため method="POST" とし、 # 本文にも同じ params を送る response = await _make_request( "json/getStatsDatas", params, method="POST", data=params, ) return cast(dict[str, Any], response)
  • Registers the get_stats_data_bulk tool with the FastMCP server using the mcp.tool() decorator.
    mcp.tool()(get_stats_data_bulk)
  • Imports get_stats_data_bulk from the tools module to make it available 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, )
  • Re-exports get_stats_data_bulk from stats.py module in tools.__init__.
    from e_stats_mcp.tools.stats import ( get_meta_info, get_meta_info_csv, get_stats_data, get_stats_data_bulk, get_stats_data_csv, get_stats_list, get_stats_list_csv, search_stats_by_keyword, )
  • Includes get_stats_data_bulk in __all__ for easy import from tools package.
    __all__ = [ "get_stats_list", "get_stats_list_csv", "get_meta_info", "get_meta_info_csv", "get_stats_data", "get_stats_data_csv", "get_stats_data_bulk", "search_stats_by_keyword", "post_dataset", "get_dataset", "get_data_catalog", "get_data_catalog_csv", "get_stats_fields", ]

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/koizumikento/e-stats-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server