Skip to main content
Glama
ncejda-g2

Snowflake MCP Server

by ncejda-g2

execute_query

Execute read-only SQL queries on Snowflake and return results as compact text, with optional database and schema context.

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
result block whose shape depends on row count:
- ONE row: aligned `NAME  value` lines (one column per line), any width.
- 2+ narrow rows: positional TSV (line 1 = tab-separated column names, one
  row per line after). Parse with awk/cut, e.g. `awk -F'\t' 'NR>1 && $3=="X"'`.
NULL = `\N`; tabs/newlines escaped so each field is one line.

Multi-row results that are wide, tall, or too large auto-spill the COMPLETE
result to a temp `.tsv` file; the payload then carries `results_file` and
`column_index` (name->position) and NO inline rows. Read/grep/awk the file
(it has its own header line); `rows:` is always the true total.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
schemaNo
databaseNo
Behavior5/5

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

Given no annotations, the description thoroughly discloses behavior: read-only restriction, compact TEXT payload format with headers, handling of different row counts, and spilling to file for large results. No contradictions.

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?

Description is well-structured with clear sections (overview, prerequisite, parameters, return format, example). Though lengthy, each sentence adds useful information; no filler.

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?

No output schema exists, so description fully compensates by detailing return format, edge cases (single row, multiple rows, large results), and caching behavior. Complete for a complex tool.

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%, but description provides meaningful explanations for all three parameters (sql, database, schema), indicating sql is the query, and database/schema are optional contexts. Adds value beyond schema types.

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

Purpose4/5

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

Description clearly states it executes read-only SQL queries (SELECT, SHOW, DESCRIBE, WITH), providing a specific verb and resource. However, it does not explicitly distinguish from sibling tools like execute_query_to_file or describe_table, lacking sibling differentiation.

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

Usage Guidelines2/5

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

No guidance on when to use vs. alternatives. It mentions a prerequisite (populated schema cache) but does not exclude cases or compare with siblings like execute_query_to_file for file output.

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