Skip to content
Development
Skill

/snowflake-query

Run SQL queries against Snowflake through the Managed MCP Server. Use for data retrieval, aggregations, joins, semi-structured data, time travel, and any explicit SQL the user requests.

From plugin
snowflake-ai-kit
4210 skills

Claude Code

$ npx -y skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query --agent claude-code

SKILL.md

snowflake-query.SKILL.md
name: snowflake-query
description: >-
  Run SQL queries against Snowflake through the Managed MCP Server.
  Use for data retrieval, aggregations, joins, semi-structured data,
  time travel, and any explicit SQL the user requests.

Snowflake Query

Run SQL queries against Snowflake. Use this skill when the user asks to query data, run SQL, or retrieve specific results.

When to use

  • User asks to query, select, or look at data
  • User provides a specific SQL statement to run
  • User asks about row counts, aggregations, or filtered results
  • User needs joins, window functions, or CTEs

How to use

1. Identify the SQL. Use Snowflake dialect (ILIKE, TRY_CAST, FLATTEN, QUALIFY). 2. Send the query to the MCP server. With the default setup in this plugin's README, that's the `cortex_code_agent` tool. If the server exposes a dedicated SQL execution tool, use that instead. 3. Summarize results. For large sets, show a sample and total count.

Examples

**Simple count:**

SELECT COUNT(*) AS row_count FROM my_db.my_schema.orders;

**Top-N with aggregation:**

SELECT customer_name, SUM(amount) AS total_revenue
FROM orders
GROUP BY customer_name
ORDER BY total_revenue DESC
LIMIT 10;

**Join with filter:**

SELECT o.order_id, c.name, o.amount
FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.created_at >= DATEADD(day, -30, CURRENT_DATE())
ORDER BY o.amount DESC
LIMIT 20;

**Semi-structured (VARIANT/JSON):**

SELECT
  raw:event_type::STRING AS event_type,
  raw:user.name::STRING AS user_name,
  raw:timestamp::TIMESTAMP AS event_time
FROM events
WHERE raw:event_type::STRING ILIKE '%purchase%'
LIMIT 10;

**Flatten arrays:**

SELECT t.order_id, f.value:product_name::STRING AS product
FROM orders t,
LATERAL FLATTEN(input => t.items) f
LIMIT 20;

**Time travel:**

SELECT * FROM orders AT(TIMESTAMP => '2025-01-15 10:00:00'::TIMESTAMP) LIMIT 10;

**Window function with QUALIFY:**

SELECT customer_id, order_date, amount
FROM orders
QUALIFY ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) = 1;

Important

  • Default to read-only (SELECT). Never run DDL/DML unless explicitly requested.
  • Always use LIMIT on exploratory queries.
  • If a query fails, report the error and suggest a fix.
  • MCP responses truncate at 250KB — aggregate or narrow your SELECT if results are large.
Read more
@snowflake-labs
Ships withsnowflake-ai-kit

Connect your AI coding agent to Snowflake. Plugins for Claude Code and OpenAI Codex that automatically detect Snowflake prompts and route them to Cortex Code — where 55+ built-in skills handle SQL, data governance, dynamic tables, ML, and more.

Stars on GitHub

Momentum

stars in total
42
Star history of Snowflake-Labs/snowflake-ai-kit on GitHub, a chart by star-history.com

Other skills on snowflake-ai-kit.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about snowflake-query.

Which coding agents can use snowflake-query?
snowflake-query installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.