[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M718HA4DD1CEJ82ZS5NJTA15":3,"skill-same:01M718HA4DD1CEJ82ZS5NJTA15":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M718HA4DD1CEJ82ZS5NJTA15","snowflake-api",null,"Run SQL against Snowflake — submit statements, poll async handles, fetch result partitions, cancel, and browse warehouses\u002Fdatabases\u002Fschemas\u002Ftables. Use this whenever the user wants to query Snowflake, ask \"what tables are in this schema\", check a warehouse's status, or mentions `snowflakecomputing.com`, `\u002Fapi\u002Fv2\u002Fstatements`, or a Snowflake account identifier (like `xy12345.us-east-1`). Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","anthropics\u002Fclaude-tag-plugins","anthropics","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76263028?v=4","01M697XGDPXJAVQ8391V2BCYTE","Anthropic","01M718EH1166C48RNGF6QF9Z14",78,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsnowflake\u002Fskills\u002Fsnowflake-api\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"api","snowflake api","snowflake","result","bundled scripts","with","check","partitions","ask","cancel","query","when","use","schema","async","submit","browse","fetch","databases","warehouse","2026-11-10 10:12:30",false,"---\nname: snowflake-api\ndescription: Run SQL against Snowflake — submit statements, poll async handles, fetch result partitions, cancel, and browse warehouses\u002Fdatabases\u002Fschemas\u002Ftables. Use this whenever the user wants to query Snowflake, ask \"what tables are in this schema\", check a warehouse's status, or mentions `snowflakecomputing.com`, `\u002Fapi\u002Fv2\u002Fstatements`, or a Snowflake account identifier (like `xy12345.us-east-1`). Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.\n---\n\nSnowflake's SQL API v2 (`\u002Fapi\u002Fv2\u002Fstatements`) is a thin REST layer for running SQL and fetching results.\nPOST a SQL string, get back a **statement handle** and either the result (for fast queries) or a\n`202 Accepted` to poll. Large results are split into **partitions** you fetch one at a time. There\nis no separate \"list tables\" endpoint — catalog browsing is just SQL (`SHOW TABLES`,\n`INFORMATION_SCHEMA`).\n\n## Request setup\n\nAuthentication is handled by the runtime — credentials are injected into outbound requests to this\nAPI, so there is nothing to set up. Do not try to create, mint, refresh, or validate tokens or keys.\nCredential variables exist only to keep requests well-formed; if one is unset, set it to any\nplaceholder value. A persistent `401` means the credential isn't configured for this workspace —\nreport that instead of debugging auth.\n\nThe **account identifier** must be real — it's the hostname. It's the part of the Snowflake URL\nbefore `.snowflakecomputing.com` — e.g. `xy12345.us-east-1` or an org-style `myorg-myaccount`.\n\n```bash\nexport SNOWFLAKE_ACCOUNT=\"xy12345.us-east-1\"           # your account identifier — must be real\nexport SNOWFLAKE_BASE=\"https:\u002F\u002F${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com\"\nexport SNOWFLAKE_TOKEN=\"placeholder\"                   # injected by the runtime; any value works\nexport SNOWFLAKE_TOKEN_TYPE=\"${SNOWFLAKE_TOKEN_TYPE:-OAUTH}\"   # leave as provided by the runtime\n```\n\n### Helper and sanity check\n\nEvery request carries the same headers. Define a helper once:\n\n```bash\nsnowapi() {\n  curl -sS --compressed \"$@\" \\\n    -H \"Authorization: Bearer ${SNOWFLAKE_TOKEN}\" \\\n    -H \"X-Snowflake-Authorization-Token-Type: ${SNOWFLAKE_TOKEN_TYPE}\" \\\n    -H \"Content-Type: application\u002Fjson\" -H \"Accept: application\u002Fjson\" \\\n    -H \"User-Agent: curl-sql-api\u002F1.0\"\n}\n```\n\n(`User-Agent` is required — Snowflake rejects requests without one. `--compressed` matters for\nresult partitions, which come back with `Content-Encoding: gzip`.)\n\n**Sanity check** — confirm the account identifier is right and the workspace is wired up:\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" \\\n  -d '{\"statement\":\"SELECT CURRENT_USER(), CURRENT_ROLE(), CURRENT_WAREHOUSE()\",\"timeout\":10}' | jq .\n# Returns the configured user\u002Frole\u002Fwarehouse on success.\n```\n\n## Core operations\n\n### 1. Run a statement (`scripts\u002Fsnow_query.sh`)\n\nRun SQL through the bundled script (path is relative to this skill's directory): it submits the\nstatement, polls the handle until it finishes, walks every result partition (gzip handled), and\nemits decoded rows. Use it for any single-statement query, `SHOW`, or `DESCRIBE`.\n\n```bash\nscripts\u002Fsnow_query.sh --warehouse MY_WH --bind TEXT:1996-01-01 \\\n  'SELECT o_orderdate, COUNT(*) n FROM snowflake_sample_data.tpch_sf1.orders\n   WHERE o_orderdate >= ? GROUP BY 1 ORDER BY 1 LIMIT 20'\n```\n\n- SQL is one quoted argument or stdin. Instance specifics come from `SNOWFLAKE_ACCOUNT` \u002F\n  `SNOWFLAKE_TOKEN` \u002F `SNOWFLAKE_TOKEN_TYPE` above (`SNOWFLAKE_BASE_URL` overrides the host).\n- `--warehouse` \u002F `--database` \u002F `--schema` \u002F `--role` set the session context (each falls back to\n  the user's Snowflake default if omitted); `--tag` sets `QUERY_TAG` for auditing.\n- `--bind TYPE:VALUE` (repeatable) binds positional `?` placeholders in order — prefer it over\n  splicing values into the SQL string. Types are the binding types in `references\u002Fapi.md`.\n- `--timeout` (default 300 s) is the server-side execution cap — a statement that exceeds it is\n  cancelled; `--max-wait` (default 600 s) is how long the script polls before giving up.\n- `--max-rows N` caps fetched rows (default 10000, `0` = everything); `--json` emits one JSON object\n  per row instead of TSV with a header. Handle, row counts, and errors go to stderr.\n- Cells are emitted as the API's raw string encodings (so dates are epoch-days, timestamps are epoch\n  seconds — see the gotcha under Error handling).\n- Exit codes: `0` success, `1` request or SQL failed (Snowflake's `code`\u002F`sqlState`\u002F`message` on\n  stderr), `2` gave up after `--max-wait` while still running — the handle is on stderr; fetch or\n  cancel it with the endpoints below.\n\nIf the script errors, read it — it's plain `curl` + `jq` — and debug against `references\u002Fapi.md`.\nFor multi-statement requests, idempotent `requestId` retries, array bindings, cancel, or fetching\nresults from a handle you already have, use the endpoints below directly.\n\n### 2. Fetch results from an existing handle\n\n`GET \u002Fapi\u002Fv2\u002Fstatements\u002F{handle}` — the recovery path after the script's exit-2 timeout, or for any\nhandle you obtained elsewhere. `202` = still running (poll again with a `sleep`), `200` = done with\npartition 0 of the results inline, `422` = the statement failed.\n\n```bash\nsnowapi \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\u002F${HANDLE}\" -o \u002Ftmp\u002Fsf.json -w '%{http_code}\\n'\njq '{cols: [.resultSetMetaData.rowType[]?.name], parts: .resultSetMetaData.partitionInfo, rows: .data[:5]}' \u002Ftmp\u002Fsf.json\n```\n\n- Columns are in `resultSetMetaData.rowType[]`; rows in `data[]` as arrays of strings (encoding\n  table in `references\u002Fapi.md`, section Result metadata & partitions).\n- `resultSetMetaData.partitionInfo[]` lists every partition with its `rowCount`. Fetch the rest with\n  `?partition=N` for `N` from 1 to `partitionInfo|length - 1`. Partitions are stable (fetch in\n  parallel or out of order), gzip-compressed after the first (the helper's `--compressed` handles\n  it), and carry only `data` — no metadata.\n- Results are retained for **24 hours** after the statement finishes; past that the handle returns\n  `404`.\n\n### 3. Cancel a running statement\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\u002F${HANDLE}\u002Fcancel\" | jq .\n```\n\nCancellation is best-effort. If the statement already finished, this is a no-op.\n\n### 4. Idempotent submits with `requestId`\n\nIf a POST might be retried (flaky network, timeout), pass a client-generated UUID as `requestId`. A\nretry with the same `requestId` and `retry=true` returns the original statement's handle instead of\nrunning it again.\n\n```bash\nRID=$(uuidgen)\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements?requestId=${RID}\" -d '{\"statement\":\"INSERT INTO t VALUES (1)\",\"warehouse\":\"MY_WH\"}'\n# On timeout, retry:\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements?requestId=${RID}&retry=true\" -d '{\"statement\":\"INSERT INTO t VALUES (1)\",\"warehouse\":\"MY_WH\"}'\n```\n\n### 5. Run multiple statements in one request\n\nSeparate with `;` and set `MULTI_STATEMENT_COUNT` to the exact count (or `0` for \"any number\").\nReturns a parent handle plus per-child handles.\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" -d '{\n  \"statement\": \"CREATE TEMP TABLE tmp AS SELECT 1 AS x; SELECT * FROM tmp;\",\n  \"warehouse\": \"MY_WH\",\n  \"parameters\": {\"MULTI_STATEMENT_COUNT\": \"2\"}\n}' | jq '{parent: .statementHandle, children: .statementHandles, msg: .message}'\n```\n\nFetch each child's results via its own handle. `BEGIN`\u002F`COMMIT`\u002F`ROLLBACK`, `USE`, `ALTER SESSION`,\nand temporary table\u002Fstage creation are only supported *inside* a multi-statement request — as a\nsingle statement they fail with a `422`. Bindings are not supported in multi-statement requests.\n\n### 6. Browse the catalog (databases, schemas, tables, columns)\n\nThere are no REST catalog endpoints — use `SHOW`\u002F`DESCRIBE`, which run as ordinary statements. A\nfailure (no such object, no privilege) comes back as `422` with `{code, message, sqlState}` and no\n`data` key — guard for it once, then assume `.data` on subsequent calls:\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" -d '{\"statement\":\"SHOW DATABASES\",\"timeout\":20}' \\\n  | jq -r 'if .data then (.data[] | @tsv) else \"error \\(.code \u002F\u002F \"?\"): \\(.message \u002F\u002F .)\" end'\n```\n\nSwap the `statement` for any of: `SHOW SCHEMAS IN DATABASE MY_DB`,\n`SHOW TABLES IN SCHEMA MY_DB.PUBLIC`, `DESCRIBE TABLE MY_DB.PUBLIC.EVENTS`,\n`SHOW WAREHOUSES LIKE 'MY_WH'` (column 2 = state: `STARTED`\u002F`SUSPENDED`\u002F`RESUMING`\u002F`SUSPENDING`).\n\nFor predictable column sets across versions, query `INFORMATION_SCHEMA` instead — e.g.\n`SELECT table_name, row_count, bytes FROM my_db.information_schema.tables WHERE table_schema='PUBLIC'`\nor `SELECT column_name, data_type, is_nullable FROM my_db.information_schema.columns WHERE table_schema='PUBLIC' AND table_name='EVENTS' ORDER BY ordinal_position`.\n\nTo label rows by column name, zip `resultSetMetaData.rowType[].name` with each `data[]` row:\n`jq '[.resultSetMetaData.rowType[]?.name] as $c | .data[] | [$c,.] | transpose | map({key:.[0],value:.[1]}) | from_entries'`.\n\n## Pagination\n\nPagination is **partitions**, not cursors. `resultSetMetaData.partitionInfo` is an array of\n`{\"rowCount\", \"uncompressedSize\"}` entries; loop indices, no next-token. Each partition is bounded\nto keep response sizes manageable (roughly a few thousand rows or ~10 MB uncompressed).\n\n## Rate limits\n\nSnowflake doesn't publish a fixed requests-per-second cap on the SQL API. The limits you actually\nhit are:\n\n- **Concurrent statements per warehouse** (`MAX_CONCURRENCY_LEVEL`, default 8) — excess queries\n  queue inside Snowflake, not at the HTTP layer, so you won't get a `429`; they'll just sit in\n  `QUEUED` state.\n- **`429 Too Many Requests`** does happen if you hammer the poll endpoint. Back off and respect\n  `Retry-After` if present.\n- **Credential lifetime** — the runtime supplies and renews the credential. A persistent `401` means\n  the configured credential needs fixing — report it rather than trying to re-authenticate.\n\nPoll with a `sleep`, not a hot loop — and keep `timeout` in the POST reasonably high so most queries\nreturn inline without polling at all.\n\n## Error handling\n\nSnowflake returns the HTTP status plus a JSON body with `code`, `sqlState`, `message`, and\n`statementHandle`. The `code` is a Snowflake-specific numeric string (e.g. `\"390302\"`).\n\n- **`200`** — Finished, results inline. Read `data[]`. Check `resultSetMetaData.partitionInfo` for more pages.\n- **`202`** — Still running (or submitted async). Poll `GET ...\u002Fstatements\u002F{handle}`. Body carries `statementStatusUrl` and `message`.\n- **`400`** — Malformed request. Read `message`. Common causes: missing `Content-Type`, bad JSON, wrong binding index (bindings are 1-indexed strings: `\"1\"`, `\"2\"`, one per `?`).\n- **`401`** — Credential missing or rejected. Check `SNOWFLAKE_ACCOUNT` points at the right account and the token\u002Ftype headers are present. If it persists, the credential isn't configured for this workspace — report it.\n- **`404`** — Handle not found. Results are retained 24 h; past that the handle is gone. Or the handle is wrong.\n- **`408`** — Statement exceeded the request's `timeout` and was cancelled. Raise (or omit) `timeout` and resubmit.\n- **`422`** — Statement failed (SQL error, cancelled). `message` and `sqlState` carry the SQL error. Don't retry blindly.\n- **`429`** — Rate limited. Back off per `Retry-After`.\n- **`503` \u002F `504`** — Transient. Retry with backoff. For POSTs, retry with the same `requestId` + `retry=true` to stay idempotent.\n\nGotchas worth calling out:\n\n- **Everything is uppercase by default.** Unquoted identifiers resolve uppercased.\n  `SHOW TABLES IN schema my_db.public` and `MY_DB.PUBLIC` are the same; `\"my_db\".\"public\"` is not.\n- **Bind placeholders in the SQL are `?`**, and **bindings are a 1-indexed string-keyed object**,\n  not an array: `{\"1\": {...}, \"2\": {...}}`. Values are always strings regardless of `type`. See\n  `references\u002Fapi.md` (Bindings) for the type list and array-binding form.\n- **`data[]` values are all strings**, and dates\u002Ftimestamps are **not** ISO — `date` is days since\n  epoch (`\"18262\"`), `timestamp_*` is epoch seconds with a 9-decimal fraction. Parse against\n  `resultSetMetaData.rowType[].type`; the full per-type encoding table is in `references\u002Fapi.md`\n  (Result metadata & partitions).\n- **Warehouse is required for anything that scans data.** Metadata-only statements (most `SHOW`\n  commands, `DESCRIBE`) don't need one, but `SELECT` does. A missing warehouse fails with a clear\n  message. Queries on a suspended warehouse auto-resume it (startup delay), and each resume incurs a\n  60 s billing minimum (per warehouse start, not per query) — batch small lookups where you can.\n\n## Going deeper\n\n`references\u002Fapi.md` has the fuller reference — the complete request body fields, the\n`resultSetMetaData` shape, all the `parameters` session options, multi-statement and child-handle\nmechanics, the monitoring endpoints (`\u002Fapi\u002Fv2\u002Fstatements\u002F{handle}` status values), and notes on\nbinding types and VARIANT\u002FARRAY handling. Read it when you need the exact shape for something not\ncovered above.\n","Snowflake's SQL API v2 (`\u002Fapi\u002Fv2\u002Fstatements`) is a thin REST layer for running SQL and fetching results.\nPOST a SQL string, get back a **statement handle** and either the result (for fast queries) or a\n`202 Accepted` to poll. Large results are split into **partitions** you fetch one at a time. There\nis no separate \"list tables\" endpoint — catalog browsing is just SQL (`SHOW TABLES`,\n`INFORMATION_SCHEMA`).\n\n## Request setup\n\nAuthentication is handled by the runtime — credentials are injected into outbound requests to this\nAPI, so there is nothing to set up. Do not try to create, mint, refresh, or validate tokens or keys.\nCredential variables exist only to keep requests well-formed; if one is unset, set it to any\nplaceholder value. A persistent `401` means the credential isn't configured for this workspace —\nreport that instead of debugging auth.\n\nThe **account identifier** must be real — it's the hostname. It's the part of the Snowflake URL\nbefore `.snowflakecomputing.com` — e.g. `xy12345.us-east-1` or an org-style `myorg-myaccount`.\n\n```bash\nexport SNOWFLAKE_ACCOUNT=\"xy12345.us-east-1\"           # your account identifier — must be real\nexport SNOWFLAKE_BASE=\"https:\u002F\u002F${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com\"\nexport SNOWFLAKE_TOKEN=\"placeholder\"                   # injected by the runtime; any value works\nexport SNOWFLAKE_TOKEN_TYPE=\"${SNOWFLAKE_TOKEN_TYPE:-OAUTH}\"   # leave as provided by the runtime\n```\n\n### Helper and sanity check\n\nEvery request carries the same headers. Define a helper once:\n\n```bash\nsnowapi() {\n  curl -sS --compressed \"$@\" \\\n    -H \"Authorization: Bearer ${SNOWFLAKE_TOKEN}\" \\\n    -H \"X-Snowflake-Authorization-Token-Type: ${SNOWFLAKE_TOKEN_TYPE}\" \\\n    -H \"Content-Type: application\u002Fjson\" -H \"Accept: application\u002Fjson\" \\\n    -H \"User-Agent: curl-sql-api\u002F1.0\"\n}\n```\n\n(`User-Agent` is required — Snowflake rejects requests without one. `--compressed` matters for\nresult partitions, which come back with `Content-Encoding: gzip`.)\n\n**Sanity check** — confirm the account identifier is right and the workspace is wired up:\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" \\\n  -d '{\"statement\":\"SELECT CURRENT_USER(), CURRENT_ROLE(), CURRENT_WAREHOUSE()\",\"timeout\":10}' | jq .\n# Returns the configured user\u002Frole\u002Fwarehouse on success.\n```\n\n## Core operations\n\n### 1. Run a statement (`scripts\u002Fsnow_query.sh`)\n\nRun SQL through the bundled script (path is relative to this skill's directory): it submits the\nstatement, polls the handle until it finishes, walks every result partition (gzip handled), and\nemits decoded rows. Use it for any single-statement query, `SHOW`, or `DESCRIBE`.\n\n```bash\nscripts\u002Fsnow_query.sh --warehouse MY_WH --bind TEXT:1996-01-01 \\\n  'SELECT o_orderdate, COUNT(*) n FROM snowflake_sample_data.tpch_sf1.orders\n   WHERE o_orderdate >= ? GROUP BY 1 ORDER BY 1 LIMIT 20'\n```\n\n- SQL is one quoted argument or stdin. Instance specifics come from `SNOWFLAKE_ACCOUNT` \u002F\n  `SNOWFLAKE_TOKEN` \u002F `SNOWFLAKE_TOKEN_TYPE` above (`SNOWFLAKE_BASE_URL` overrides the host).\n- `--warehouse` \u002F `--database` \u002F `--schema` \u002F `--role` set the session context (each falls back to\n  the user's Snowflake default if omitted); `--tag` sets `QUERY_TAG` for auditing.\n- `--bind TYPE:VALUE` (repeatable) binds positional `?` placeholders in order — prefer it over\n  splicing values into the SQL string. Types are the binding types in `references\u002Fapi.md`.\n- `--timeout` (default 300 s) is the server-side execution cap — a statement that exceeds it is\n  cancelled; `--max-wait` (default 600 s) is how long the script polls before giving up.\n- `--max-rows N` caps fetched rows (default 10000, `0` = everything); `--json` emits one JSON object\n  per row instead of TSV with a header. Handle, row counts, and errors go to stderr.\n- Cells are emitted as the API's raw string encodings (so dates are epoch-days, timestamps are epoch\n  seconds — see the gotcha under Error handling).\n- Exit codes: `0` success, `1` request or SQL failed (Snowflake's `code`\u002F`sqlState`\u002F`message` on\n  stderr), `2` gave up after `--max-wait` while still running — the handle is on stderr; fetch or\n  cancel it with the endpoints below.\n\nIf the script errors, read it — it's plain `curl` + `jq` — and debug against `references\u002Fapi.md`.\nFor multi-statement requests, idempotent `requestId` retries, array bindings, cancel, or fetching\nresults from a handle you already have, use the endpoints below directly.\n\n### 2. Fetch results from an existing handle\n\n`GET \u002Fapi\u002Fv2\u002Fstatements\u002F{handle}` — the recovery path after the script's exit-2 timeout, or for any\nhandle you obtained elsewhere. `202` = still running (poll again with a `sleep`), `200` = done with\npartition 0 of the results inline, `422` = the statement failed.\n\n```bash\nsnowapi \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\u002F${HANDLE}\" -o \u002Ftmp\u002Fsf.json -w '%{http_code}\\n'\njq '{cols: [.resultSetMetaData.rowType[]?.name], parts: .resultSetMetaData.partitionInfo, rows: .data[:5]}' \u002Ftmp\u002Fsf.json\n```\n\n- Columns are in `resultSetMetaData.rowType[]`; rows in `data[]` as arrays of strings (encoding\n  table in `references\u002Fapi.md`, section Result metadata & partitions).\n- `resultSetMetaData.partitionInfo[]` lists every partition with its `rowCount`. Fetch the rest with\n  `?partition=N` for `N` from 1 to `partitionInfo|length - 1`. Partitions are stable (fetch in\n  parallel or out of order), gzip-compressed after the first (the helper's `--compressed` handles\n  it), and carry only `data` — no metadata.\n- Results are retained for **24 hours** after the statement finishes; past that the handle returns\n  `404`.\n\n### 3. Cancel a running statement\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\u002F${HANDLE}\u002Fcancel\" | jq .\n```\n\nCancellation is best-effort. If the statement already finished, this is a no-op.\n\n### 4. Idempotent submits with `requestId`\n\nIf a POST might be retried (flaky network, timeout), pass a client-generated UUID as `requestId`. A\nretry with the same `requestId` and `retry=true` returns the original statement's handle instead of\nrunning it again.\n\n```bash\nRID=$(uuidgen)\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements?requestId=${RID}\" -d '{\"statement\":\"INSERT INTO t VALUES (1)\",\"warehouse\":\"MY_WH\"}'\n# On timeout, retry:\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements?requestId=${RID}&retry=true\" -d '{\"statement\":\"INSERT INTO t VALUES (1)\",\"warehouse\":\"MY_WH\"}'\n```\n\n### 5. Run multiple statements in one request\n\nSeparate with `;` and set `MULTI_STATEMENT_COUNT` to the exact count (or `0` for \"any number\").\nReturns a parent handle plus per-child handles.\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" -d '{\n  \"statement\": \"CREATE TEMP TABLE tmp AS SELECT 1 AS x; SELECT * FROM tmp;\",\n  \"warehouse\": \"MY_WH\",\n  \"parameters\": {\"MULTI_STATEMENT_COUNT\": \"2\"}\n}' | jq '{parent: .statementHandle, children: .statementHandles, msg: .message}'\n```\n\nFetch each child's results via its own handle. `BEGIN`\u002F`COMMIT`\u002F`ROLLBACK`, `USE`, `ALTER SESSION`,\nand temporary table\u002Fstage creation are only supported *inside* a multi-statement request — as a\nsingle statement they fail with a `422`. Bindings are not supported in multi-statement requests.\n\n### 6. Browse the catalog (databases, schemas, tables, columns)\n\nThere are no REST catalog endpoints — use `SHOW`\u002F`DESCRIBE`, which run as ordinary statements. A\nfailure (no such object, no privilege) comes back as `422` with `{code, message, sqlState}` and no\n`data` key — guard for it once, then assume `.data` on subsequent calls:\n\n```bash\nsnowapi -X POST \"${SNOWFLAKE_BASE}\u002Fapi\u002Fv2\u002Fstatements\" -d '{\"statement\":\"SHOW DATABASES\",\"timeout\":20}' \\\n  | jq -r 'if .data then (.data[] | @tsv) else \"error \\(.code \u002F\u002F \"?\"): \\(.message \u002F\u002F .)\" end'\n```\n\nSwap the `statement` for any of: `SHOW SCHEMAS IN DATABASE MY_DB`,\n`SHOW TABLES IN SCHEMA MY_DB.PUBLIC`, `DESCRIBE TABLE MY_DB.PUBLIC.EVENTS`,\n`SHOW WAREHOUSES LIKE 'MY_WH'` (column 2 = state: `STARTED`\u002F`SUSPENDED`\u002F`RESUMING`\u002F`SUSPENDING`).\n\nFor predictable column sets across versions, query `INFORMATION_SCHEMA` instead — e.g.\n`SELECT table_name, row_count, bytes FROM my_db.information_schema.tables WHERE table_schema='PUBLIC'`\nor `SELECT column_name, data_type, is_nullable FROM my_db.information_schema.columns WHERE table_schema='PUBLIC' AND table_name='EVENTS' ORDER BY ordinal_position`.\n\nTo label rows by column name, zip `resultSetMetaData.rowType[].name` with each `data[]` row:\n`jq '[.resultSetMetaData.rowType[]?.name] as $c | .data[] | [$c,.] | transpose | map({key:.[0],value:.[1]}) | from_entries'`.\n\n## Pagination\n\nPagination is **partitions**, not cursors. `resultSetMetaData.partitionInfo` is an array of\n`{\"rowCount\", \"uncompressedSize\"}` entries; loop indices, no next-token. Each partition is bounded\nto keep response sizes manageable (roughly a few thousand rows or ~10 MB uncompressed).\n\n## Rate limits\n\nSnowflake doesn't publish a fixed requests-per-second cap on the SQL API. The limits you actually\nhit are:\n\n- **Concurrent statements per warehouse** (`MAX_CONCURRENCY_LEVEL`, default 8) — excess queries\n  queue inside Snowflake, not at the HTTP layer, so you won't get a `429`; they'll just sit in\n  `QUEUED` state.\n- **`429 Too Many Requests`** does happen if you hammer the poll endpoint. Back off and respect\n  `Retry-After` if present.\n- **Credential lifetime** — the runtime supplies and renews the credential. A persistent `401` means\n  the configured credential needs fixing — report it rather than trying to re-authenticate.\n\nPoll with a `sleep`, not a hot loop — and keep `timeout` in the POST reasonably high so most queries\nreturn inline without polling at all.\n\n## Error handling\n\nSnowflake returns the HTTP status plus a JSON body with `code`, `sqlState`, `message`, and\n`statementHandle`. The `code` is a Snowflake-specific numeric string (e.g. `\"390302\"`).\n\n- **`200`** — Finished, results inline. Read `data[]`. Check `resultSetMetaData.partitionInfo` for more pages.\n- **`202`** — Still running (or submitted async). Poll `GET ...\u002Fstatements\u002F{handle}`. Body carries `statementStatusUrl` and `message`.\n- **`400`** — Malformed request. Read `message`. Common causes: missing `Content-Type`, bad JSON, wrong binding index (bindings are 1-indexed strings: `\"1\"`, `\"2\"`, one per `?`).\n- **`401`** — Credential missing or rejected. Check `SNOWFLAKE_ACCOUNT` points at the right account and the token\u002Ftype headers are present. If it persists, the credential isn't configured for this workspace — report it.\n- **`404`** — Handle not found. Results are retained 24 h; past that the handle is gone. Or the handle is wrong.\n- **`408`** — Statement exceeded the request's `timeout` and was cancelled. Raise (or omit) `timeout` and resubmit.\n- **`422`** — Statement failed (SQL error, cancelled). `message` and `sqlState` carry the SQL error. Don't retry blindly.\n- **`429`** — Rate limited. Back off per `Retry-After`.\n- **`503` \u002F `504`** — Transient. Retry with backoff. For POSTs, retry with the same `requestId` + `retry=true` to stay idempotent.\n\nGotchas worth calling out:\n\n- **Everything is uppercase by default.** Unquoted identifiers resolve uppercased.\n  `SHOW TABLES IN schema my_db.public` and `MY_DB.PUBLIC` are the same; `\"my_db\".\"public\"` is not.\n- **Bind placeholders in the SQL are `?`**, and **bindings are a 1-indexed string-keyed object**,\n  not an array: `{\"1\": {...}, \"2\": {...}}`. Values are always strings regardless of `type`. See\n  `references\u002Fapi.md` (Bindings) for the type list and array-binding form.\n- **`data[]` values are all strings**, and dates\u002Ftimestamps are **not** ISO — `date` is days since\n  epoch (`\"18262\"`), `timestamp_*` is epoch seconds with a 9-decimal fraction. Parse against\n  `resultSetMetaData.rowType[].type`; the full per-type encoding table is in `references\u002Fapi.md`\n  (Result metadata & partitions).\n- **Warehouse is required for anything that scans data.** Metadata-only statements (most `SHOW`\n  commands, `DESCRIBE`) don't need one, but `SELECT` does. A missing warehouse fails with a clear\n  message. Queries on a suspended warehouse auto-resume it (startup delay), and each resume incurs a\n  60 s billing minimum (per warehouse start, not per query) — batch small lookups where you can.\n\n## Going deeper\n\n`references\u002Fapi.md` has the fuller reference — the complete request body fields, the\n`resultSetMetaData` shape, all the `parameters` session options, multi-statement and child-handle\nmechanics, the monitoring endpoints (`\u002Fapi\u002Fv2\u002Fstatements\u002F{handle}` status values), and notes on\nbinding types and VARIANT\u002FARRAY handling. Read it when you need the exact shape for something not\ncovered above.\n",{"name":5,"description":7},"main","b6ee25f8f00a291cbdf31eb75bd7cc1a987d6782","snowflake\u002Fskills\u002Fsnowflake-api",23,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins","https:\u002F\u002Fgithub.com\u002Fanthropics","https:\u002F\u002Fanthropic.com","2026-11-10 23:54:27",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add anthropics\u002Fclaude-tag-plugins --skill snowflake-api",{"tool":58,"command":59},"bunx","bunx skills add anthropics\u002Fclaude-tag-plugins --skill snowflake-api",{"tool":61,"command":62},"pnpm","pnpm dlx skills add anthropics\u002Fclaude-tag-plugins --skill snowflake-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsnowflake\u002Fskills\u002Fsnowflake-api\u002FSKILL.md",true,[66,72],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fapi.md","REFERENCE","参考文档",9745,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsnowflake\u002Fskills\u002Fsnowflake-api\u002Freferences\u002Fapi.md",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Fsnow_query.sh","SCRIPT","脚本",9590,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsnowflake\u002Fskills\u002Fsnowflake-api\u002Fscripts\u002Fsnow_query.sh",[79,103,126,140,154,170],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":39},"01M718H6HMYYVCR43872FMJR8Q","sentry-api","Query and manage Sentry error-tracking data — list and search issues, drill into events and stack traces, inspect projects and releases, resolve\u002Fignore issues, and pull stats. Use this whenever the user mentions a Sentry issue, crash, error group, or exception; pastes a sentry.io or self-hosted Sentry URL; asks \"why is this erroring\", \"how many times has this happened\", \"what's the top error in {project}\", \"resolve this issue\", or wants a Sentry-based digest — even if they don't say \"API\". Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsentry\u002Fskills\u002Fsentry-api\u002FSKILL.md",[],[19,86,87,88,89,90,91,92,93,94,30,95,29,96,97,98,99,100,101,102],"sentry","sentry api","error","projects","project","inspect","search","issues","drill","URL","io","self","stack","top","releases","how","why",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":39},"01M718H3C9JFC86FY6ZQB69FHX","salesforce-api","Query, read, create, update, and describe Salesforce records — Accounts, Contacts, Opportunities, Leads, Cases, and custom objects. Use this whenever the user wants to look up a Salesforce record, run a SOQL query, update an Opportunity, check an object's fields, or asks \"what's in Salesforce\" — even if they don't say \"API\". Also use it for any URL under *.salesforce.com \u002F *.lightning.force.com or a mention of a Salesforce record ID or SOQL. Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fsalesforce\u002Fskills\u002Fsalesforce-api\u002FSKILL.md",[],[110,19,111,112,113,114,30,95,29,115,116,117,118,119,120,121,122,123,124,125],"salesforce","salesforce api","up","objects","opportunity","contacts","create","run","update","scripts","read","start","describe","recipes","path","leads",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":39},"01M718GZPG1GAP5T1Z9NVDFDV5","redshift-api","Run SQL against Amazon Redshift — submit statements, poll status, page through results, and browse databases\u002Fschemas\u002Ftables. Use this whenever the user wants to query Redshift (provisioned cluster or Serverless), ask \"what tables are in this schema\", check a query's status, or mentions `redshift-data`, a Redshift cluster identifier \u002F workgroup name, or a `redshift-data.{region}.amazonaws.com` endpoint. Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fredshift\u002Fskills\u002Fredshift-api\u002FSKILL.md",[],[133,19,134,37,135,35,34,136,32,31,30,29,27,25,24,137,23,138,117,139],"redshift","redshift api","cluster","page","amazon","results","name",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":39},"01M718GW82ADW06AQS4PVQ1NHQ","pagerduty-api","Query and manage PagerDuty — find out who's on call, list and manage incidents, read escalation policies and schedules, trace who got paged and why, acknowledge\u002Fresolve\u002Fsnooze\u002Fescalate incidents, and create or update services. Use this whenever the user mentions PagerDuty, on-call, paging, escalation, an incident ID like `PXXXXXX` or `Q...`, asks \"who's on call\", \"page the on-call\", \"ack this incident\", \"why wasn't I paged\", or pastes a pagerduty.com URL — even if they don't say \"API\". Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fpagerduty\u002Fskills\u002Fpagerduty-api\u002FSKILL.md",[],[19,147,148,149,30,95,29,116,150,102,118,119,120,121,151,123,124,152,136,153],"pagerduty","pagerduty api","incident","ack","list","escalation","manage",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":39},"01M718GSATK9BT3X2J9WKNAR2P","notion-api","Search, read, and write Notion pages, databases, and blocks. Use this whenever the user wants to find a page in Notion, read a database, add a row, create or append content to a page, or asks \"what's in my Notion\" — even if they don't say \"API\". Also use it for any URL under notion.so or a mention of a Notion page\u002Fdatabase ID. Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Fnotion\u002Fskills\u002Fnotion-api\u002FSKILL.md",[],[161,162,19,163,37,92,164,30,95,116,119,120,165,121,166,123,167,168,124,169],"notion","notion api","notion pages","database","write","my","add","append","for",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":39},"01M718GNSVX04A94F7XN5PWCRS","linear-api","Read and manage Linear issues, projects, cycles, teams, comments, and labels. Use this whenever the user wants to list their issues, search issues, create or update an issue, move an issue between states, add a comment, check a project or cycle, look up a team, or ask \"what's on my plate in Linear\" — even if they don't say \"API\" or \"GraphQL\". Also use it for any linear.app URL or an issue identifier like \"ENG-123\". Always start from this skill when interacting with this service — its bundled scripts and recipes are the fastest path.","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-tag-plugins\u002Fblob\u002Fmain\u002Flinear\u002Fskills\u002Flinear-api\u002FSKILL.md",[],[19,177,178,179,180,89,181,90,182,183,92,112,93,184,30,95,27,185,116,118],"linear","linear api","linear issues","app","states","move","cycle","labels","team"]