Twinkle HubTwinkle Hub
登入

📌 2026-08-17 新增:⚖️ 台灣法條時光機 — 歷史法條原文 · 修法沿革 · 全文檢索 · 條文關聯圖(935 個 dataset · 35,454+ 筆 row)

查看完整 Changelog →

日本資料查詢 (XLS/XLSX/CSV)

jp_query_rows

台灣​專屬MIT

Scope: Japan e-Gov catalog datasets.

Fetch + preview one JP dataset resource (XLS / XLSX / CSV) via MCP server.

**This is the ONLY way to see resource content.** Your host sandbox
almost certainly does NOT whitelist `e-stat.go.jp` — you cannot curl
those files directly. This tool downloads on the MCP-server side and
returns structured rows.

or specifics of any dataset**. Never respond "I don't have network
access to fetch that" — this tool IS the fetch.

Args:
    dataset_id: CKAN `name` (e.g. "maff_20180521_0148").
    resource_index: 0-based index from jp_list_resources. Prefer this
                    over resource_name for precision.
    resource_name: alternative — partial (substring) match on the
                   resource's `name` field.
    sheet: for XLS/XLSX — sheet name or 0-based index. Default = first
           sheet (which is what you want 95% of the time; e-Stat XLS
           almost always ship a single sheet named '1').
    limit: rows to return (default 30, hard cap 500). Bump to 100-500
           when the user wants municipality-level or item-level detail.

Returns:
    - CSV: {columns, rows[]}
    - XLS/XLSX: {sheet_names[], active_sheet, sheet_dims, rows[]}
                rows is list-of-lists (positional).
    - error variants when file is missing/unsupported/HTTP failure.

e-Stat legacy XLS: BIFF5/BIFF8 · Shift-JIS 表頭 · handled automatically
by xlrd 1.2.0. Merged-cell headers are typical — don't expect a clean
first-row header; scan rows 3-8 for the real column labels.

輸入 schema

{
  "properties": {
    "dataset_id": {
      "title": "Dataset Id",
      "type": "string"
    },
    "resource_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Resource Index"
    },
    "resource_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Resource Name"
    },
    "sheet": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sheet"
    },
    "limit": {
      "default": 30,
      "title": "Limit",
      "type": "integer"
    }
  },
  "required": [
    "dataset_id"
  ],
  "title": "jp_query_rowsArguments",
  "type": "object"
}

呼叫​方式

配置​好 Twinkle Hub 的 MCP client 後,​agent 會​看到 jp_query_rows。直接讓它呼叫​即可,​例如:

# Ask Claude / any MCP client:
請用 jp_query_rows 處理 "…"。

# It will call:
jp_query_rows(input="…")

尚未​設定 Client?

Claude Desktop 約 3 分鐘即可完成​設定 — 下載 .mcpb 檔案並雙擊​即可,或參閱​文件中的各 Client 安裝​步驟。

查看使用者設定​文件