Skip to main content
Glama
ncejda-g2

Snowflake MCP Server

by ncejda-g2

execute_query

Execute read-only SQL queries (SELECT, SHOW, DESCRIBE, WITH) on Snowflake with safety validation. Returns all results; use refresh_catalog first to populate schema cache.

Instructions

Execute a read-only SQL query on Snowflake.

This tool validates queries for safety, executes them, and returns all results.
Only SELECT, SHOW, DESCRIBE, and WITH queries are allowed.

IMPORTANT: The schema cache must be populated before executing queries.
Run refresh_catalog first if this is your first query.

Parameters:
- sql: SQL query to execute (SELECT, SHOW, DESCRIBE, or WITH)
- database: Optional database context
- schema: Optional schema context

Returns:
- All query results (respects LIMIT clause if present in SQL)
- Results are cached for CSV export if under 5GB
- Use save_last_query_to_csv to export results

Note:
- If you encounter token limit issues with large result sets, consider using
  execute_big_query_to_disk instead, which streams results directly to a file
  without returning the data in the response, or consider adding a stricter LIMIT clause.

Examples:
- execute_query("SELECT * FROM SALES_DB.PUBLIC.CUSTOMERS LIMIT 10")
- execute_query("SELECT COUNT(*) FROM orders", database="SALES_DB", schema="PUBLIC")
- execute_query("SELECT * FROM large_table LIMIT 1000")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNo
schemaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses read-only safety, validation, result caching, and token limit considerations. It effectively covers behavioral traits beyond schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections and examples, though slightly verbose. Every sentence adds value, and it is front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 params, output schema, no annotations), the description covers preconditions, query types, result handling, and alternative tools comprehensively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but description adds basic meaning for each parameter (sql, database, schema). However, it does not provide detailed constraints or formats beyond schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes read-only SQL queries on Snowflake, specifies allowed query types, and distinguishes it from siblings like execute_big_query_to_disk for large results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use (after refresh_catalog), when-not-to-use (for large results, use alternative), and examples. Clear context and exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ncejda-g2/snowflake_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server