Skip to main content
Glama
ncejda-g2

Snowflake MCP Server

by ncejda-g2

execute_query

Run read-only SQL queries (SELECT, SHOW, DESCRIBE, WITH) on Snowflake and retrieve results in TSV format, with automatic handling of large result sets.

Instructions

Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, WITH) and return results.

Requires a populated schema cache; auto-refreshes on first use if empty.

Parameters:
- sql: read-only SQL query
- database: optional database context
- schema: optional schema context

Returns a compact TEXT payload (not JSON): a `key: value` header
(status, rows, cols, execution_time, query_id), a `---` separator, then a
positional TSV block. TSV rules: line 1 = tab-separated column names, one row
per line after; NULL = `\N`; tabs/newlines escaped so each row is one line.
Parse with awk/cut, e.g. `awk -F'\t' 'NR>1 && $3=="X"'`.

Large/wide/tall results auto-spill the COMPLETE result to a temp `.tsv` file;
the payload then carries `results_file`, `column_index` (name->position), and a
`spilled` marker in place of inline rows. Read/grep/awk the file; `rows:` is
always the true total.

Example: execute_query("SELECT * FROM SALES_DB.PUBLIC.CUSTOMERS LIMIT 10")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNo
schemaNo
Behavior5/5

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

No annotations provided, so the description fully bears the burden. It discloses read-only nature, schema cache requirement, auto-refresh, compact TEXT payload format with headers and TSV, spill behavior for large results, and parsing advice. This is comprehensive.

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?

The description is well-structured with clear sections and front-loaded purpose. However, the detailed explanation of TSV parsing and escape rules is somewhat verbose and could be condensed without losing essential 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 no output schema, the description adequately explains the return format, including spill behavior, making it complete for an agent to understand inputs and outputs. It covers prerequisites and edge cases.

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

Parameters4/5

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

Schema coverage is 0%, so the description must explain parameters. It does so for all three: sql (read-only SQL query), database (optional context), schema (optional context). This adds meaning beyond the schema's type-only fields, though it could be more specific about valid SQL syntax or database/schema resolution.

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 (SELECT, SHOW, DESCRIBE, WITH) and returns results, distinguishing it from siblings like execute_query_to_file which outputs to a file.

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

Usage Guidelines3/5

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

The description mentions prerequisites (populated schema cache) but does not explicitly state when to use versus alternatives like describe_table or show_tables. The context of sibling names provides some guidance, but the description lacks explicit usage boundaries.

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