Twinkle HubTwinkle Hub
Sign in

📌 2026-08-17 added: ⚖️ Taiwan statute time machine — historical article text · revision history · full-text search · citation graph (935 datasets · 35,454+ rows)

View full changelog →

JP query rows

jp_query_rows

TW-specificMIT

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.

Input 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"
}

How to call

Once your Twinkle Hub MCP client is configured, your agent will see jp_query_rows. Just ask it to call — example:

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

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

Haven't set up a client yet?

Claude Desktop in 3 minutes — download the .mcpb and double-click, or see docs for other clients.

See user docs