Data warehouseData

Snowflake Agent

Snowflake's managed MCP server lives inside your account and exposes the warehouse, role, and schema you scope it to. This template gives you a system prompt tuned for warehouse analytics, schema exploration, and credit-aware querying. **Setup note:** Snowflake MCPs are per-account and per-schema — you need to create a Cortex Agent / MCP server inside your account first, then paste your account-specific URL into the template.

Default model: Claude Sonnet 4.50 serversAccess token required

Default model

Claude Sonnet 4.5

MCP servers

Bring your own server URL

Auth

OAuth access token from your Snowflake security integration

What you can do

A few things this template does well out of the box.

  • Query warehouse metrics: which queries used the most credits last week, by warehouse and user
  • Explore a database schema and answer "what does this table mean?" questions from the schema + sample data
  • Run analytics queries (revenue, retention, funnel) without context-switching to the Snowsight console
  • Audit role-based access: who can read which schema, which roles are over-privileged
  • Compare query results across warehouses or environments (prod vs staging) in a single chat

How it works

Three steps to go from template to a live chat.

1

Click "Use this template"

Agent Studio opens with the MCP server, model and system prompt pre-filled.

2

Add your access token

OAuth access token from your Snowflake security integration

3

Start chatting

Ask a question, watch live tool calls and switch models at any time to compare answers.

Getting your access token

A quick walkthrough for the credential this template needs.

  1. 1**Create the MCP server in Snowflake**: in Snowsight → **AI & ML → Cortex Agents** → create a new MCP server. Pick a database, schema and warehouse to scope it to.
  2. 2**Get the URL**: after creation, copy the URL — it follows the format `https://<account>.snowflakecomputing.com/api/v2/databases/<DB>/schemas/<SCHEMA>/mcp-servers/<NAME>`.
  3. 3**Create an OAuth security integration** for your client (one-time setup): `CREATE SECURITY INTEGRATION mcp_oauth TYPE = OAUTH OAUTH_CLIENT = CUSTOM ...`. See [Snowflake OAuth docs](https://docs.snowflake.com/en/user-guide/oauth-custom).
  4. 4**Get an access token** via the OAuth flow (authorization code, client credentials, or PAT depending on your setup).
  5. 5Paste the URL into Agent Studio's **MCP server URL** field, the OAuth access token into **Access token**.
  6. 6**Permissions**: ensure the role bound to the OAuth integration has `USAGE` on the warehouse and `SELECT` on the tables you want the agent to read.
  7. 7Send *"List tables in this schema"* to confirm.

Try these prompts

Copy one into the studio to see the agent in action.

  • Top 10 queries by credit consumption in the last 24 hours. Group by warehouse and user.

  • Schema for `ANALYTICS.PUBLIC.ORDERS` — show columns, types, and 3 sample rows.

  • Daily revenue for the last 30 days. Show me the SQL before running.

  • Which warehouses are auto-suspending correctly and which are sitting idle and burning credits?

  • Find roles that have OWNERSHIP on schemas they don't actively use this month.

System prompt

The default instructions the model starts with. Edit it any time inside Agent Studio.

You are a Snowflake analytics assistant connected via a managed Cortex MCP server scoped to one database / schema / warehouse.

Use the available tools to:
- List databases, schemas, tables, views and stages within the scoped context
- Inspect table schemas and sample rows before writing queries
- Translate natural-language questions into Snowflake SQL
- Query ACCOUNT_USAGE / INFORMATION_SCHEMA for warehouse credit consumption, query history, and role/permission audits
- Run queries — but always show the SQL first, and prefer cheaper warehouse sizes when possible

Cost discipline:
- Always add a date / time filter on QUERY_HISTORY scans — they get expensive fast
- Use LIMIT on exploratory SELECTs; suggest CLUSTER BY or partitioning when you see repeated full-table scans
- Prefer the smallest warehouse that meets the latency requirement; mention auto-suspend when relevant
- For large aggregations, suggest materialised views or scheduled queries instead of repeated ad-hoc runs

Always render SQL in a code block before running it. Snowflake's dialect is ANSI-leaning but has quirks (QUALIFY, IDENTIFIER, etc.) — call those out when you use them.

Ready to try the Snowflake Agent?

Open Agent Studio with this template pre-loaded. Add your token, pick any model, and start chatting.

Use this template

Related templates