Skip to main content
Glama
ncejda-g2

Snowflake MCP Server

by ncejda-g2

execute_query_to_file

Writes read-only SQL query results directly to a file at a chosen path. Save output as CSV or TSV without overwriting existing files.

Instructions

Writes read-only query results to a file at a path you choose.

Use when the result needs to land at a specific path -- to share or persist.
Format follows the extension: `.csv` writes CSV (NULL = empty field);
anything else writes TSV (same as execute_query: tab-delimited, NULL = `\N`).

Parameters:
- sql: read-only SQL (SELECT, SHOW, DESCRIBE, WITH)
- file_path: output path (absolute recommended; end with `.csv` for CSV,
  else `.tsv` is used/appended)
- database: optional database context
- schema: optional schema context
- timeout_seconds: query timeout (default 300, max 3600)

Requires a populated schema cache. Will not overwrite an existing file.

Example: execute_query_to_file("SELECT * FROM t", "/tmp/export.csv")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
file_pathYes
databaseNo
schemaNo
timeout_secondsNo
Behavior5/5

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

With no annotations, the description carries full burden and discloses: read-only SQL, file overwrite prevention, format rules based on extension, timeout range, and requirement for schema cache. 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?

Well-structured with intro, usage, parameter list, constraints, example. Every sentence adds value. Slightly verbose but clear and organized.

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?

Without output schema, description covers all essential aspects: inputs, output format, constraints, timeout, and prerequisite. Agent can use correctly.

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

Parameters5/5

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

Schema coverage is 0%, but description explains each parameter: sql allowed statements, file_path path and extension, database/schema optional context, timeout_seconds default and max. Provides an example. Fully compensates.

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 writes read-only query results to a file, specifying the verb 'writes' and the resource 'results to a file'. It also distinguishes from sibling execute_query by noting the output goes to a file path, and format depends on extension.

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

Usage Guidelines4/5

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

Explicitly says 'Use when the result needs to land at a specific path -- to share or persist.' It also provides constraints like no overwrite and requires schema cache. However, it does not explicitly contrast with execute_query for when results are needed interactively.

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