Twinkle HubTwinkle Hub

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

jp_query_rows

🇯🇵 일본읽기 전용

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.

파라미터

이름타입설명
dataset_id *string
resource_indexinteger
resource_namestring
sheetstring
limitinteger
원본 JSON 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"
}

호출 방법

스타터 — 파라미터는 위 표 참조
jp_query_rows({ dataset_id: "…" })