Skip to main content
Glama

post_dataset

Register datasets to Japan's official statistics portal by specifying dataset names, statistical table IDs, and retrieval conditions for data analysis.

Instructions

データセットを登録する.

Args: dataset_name: データセット名 stats_data_id: 統計表ID conditions: 取得条件(cdCatXX, cdTime, cdArea などを辞書で指定) description: 説明文

Returns: 登録結果

Input Schema

NameRequiredDescriptionDefault
dataset_nameYes
stats_data_idYes
conditionsNo
descriptionNo

Input Schema (JSON Schema)

{ "properties": { "conditions": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null }, "dataset_name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null }, "stats_data_id": { "type": "string" } }, "required": [ "dataset_name", "stats_data_id" ], "type": "object" }

Implementation Reference

  • The main handler function `async def post_dataset(...)` that implements the tool logic by making a POST request to the e-Stat API's 'postDataset' endpoint with the provided parameters.
    async def post_dataset( dataset_name: str, stats_data_id: str, conditions: dict | None = None, description: str | None = None, ) -> dict: """データセットを登録する. Args: dataset_name: データセット名 stats_data_id: 統計表ID conditions: 取得条件(cdCatXX, cdTime, cdArea などを辞書で指定) description: 説明文 Returns: 登録結果 """ params = { "datasetName": dataset_name, "statsDataId": stats_data_id, } if description: params["description"] = description if conditions: params.update(conditions) response = await _make_request( "postDataset", params, method="POST", data=params, ) return cast(dict[str, Any], response)
  • Registers the `post_dataset` tool using `mcp.tool()(post_dataset)`.
    mcp.tool()(post_dataset)
  • Imports `post_dataset` from `dataset.py` for use in the tools module.
    from e_stats_mcp.tools.dataset import get_dataset, post_dataset

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