get_data_catalog_csv
Retrieve Japan's official government statistics catalog in CSV format by filtering with keywords, statistical fields, codes, years, or other parameters for data analysis.
Instructions
データカタログ情報をCSVで取得する.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_word | No | ||
| stats_field | No | ||
| stats_code | No | ||
| gov_code | No | ||
| survey_years | No | ||
| open_years | No | ||
| stats_name_list | No | ||
| updated_date | No | ||
| start_position | No | ||
| limit | No |
Implementation Reference
- e_stats_mcp/tools/catalog.py:63-103 (handler)The core handler function implementing the get_data_catalog_csv tool. It builds query parameters from inputs and fetches CSV data from the e-Stat API's getSimpleDataCatalog endpoint using the _make_request helper.async def get_data_catalog_csv( search_word: str | None = None, stats_field: str | None = None, stats_code: str | None = None, gov_code: str | None = None, survey_years: str | None = None, open_years: str | None = None, stats_name_list: str | None = None, updated_date: str | None = None, start_position: int | None = None, limit: int | None = None, ) -> str: """データカタログ情報をCSVで取得する.""" params: dict = {} if search_word: params["searchWord"] = search_word if stats_field: params["statsField"] = stats_field if stats_code: params["statsCode"] = stats_code if gov_code: params["governmentCode"] = gov_code if survey_years: params["surveyYears"] = survey_years if open_years: params["openYears"] = open_years if stats_name_list: params["statsNameList"] = stats_name_list if updated_date: params["updatedDate"] = updated_date if start_position: params["startPosition"] = str(start_position) if limit: params["limit"] = str(limit) response = await _make_request( "getSimpleDataCatalog", params, format="csv", ) return cast(str, response)
- e_stats_mcp/main.py:57-57 (registration)Registers the get_data_catalog_csv function as an MCP tool using the FastMCP decorator mcp.tool().mcp.tool()(get_data_catalog_csv)
- e_stats_mcp/tools/__init__.py:32-32 (registration)Exports the get_data_catalog_csv function in the tools package __all__ for easy import."get_data_catalog_csv",
- e_stats_mcp/tools/__init__.py:17-17 (helper)Imports the get_data_catalog_csv function into the tools package namespace.from e_stats_mcp.tools.catalog import get_data_catalog, get_data_catalog_csv