Skip to main content
Glama
akrym1582

sqldb-mcp-server

by akrym1582

exportQuery

Export read-only SQL query results directly to a CSV or JSON file. Streams large datasets to disk without row-count limits for efficient file export.

Instructions

Execute a read-only SELECT SQL query and stream the results to a file. Supports CSV and JSON output formats. Designed for large datasets – results are streamed directly to disk without a row-count limit. CSV options: delimiter (default ','), nullValue (default ''), bom (default false). JSON options: pretty (default false). Timeout is controlled by the EXPORT_QUERY_TIMEOUT environment variable (default: 300 s).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSELECT SQL statement whose results should be exported
formatNoOutput format. "csv" (default) or "json"
optionsNoFormat-specific options. CSV: delimiter (default ","), nullValue (default ""), bom (default false). JSON: pretty (default false). Additional keys are accepted for forward compatibility.
databaseNoDatabase to query; omit to use the default
filepathYesDestination file path (absolute, or relative to the server working directory)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / database
      Added value: +{
      +  "description": "Database to query; omit to use the default",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.1.1

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the disclosure burden. It transparently covers read-only behavior, streaming, absence of row-count limits, format defaults, and timeout via environment variable. It does not mention behavioral details such as overwriting existing files or permission requirements, though the disclosed information is substantial.

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 front-loaded with the core purpose and each sentence carries useful information. There is slight redundancy between 'streamed directly to disk' and 'without a row-count limit', but overall it remains structured and efficient.

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

Completeness4/5

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

The description covers purpose, formats, default options, large-data streaming, and timeout behavior, which is strong for a tool with no annotations and no output schema. The main gap is the lack of explicit behavior around file overwriting or what the tool returns after completion.

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 description coverage is 100%, so the schema already documents all parameters. The description mostly restates option defaults already present in the schema rather than adding new semantic meaning, keeping it at the baseline.

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 states a specific action and resource: executing a read-only SELECT query and streaming results to a file. It clearly differentiates this from the sibling 'query' tool by emphasizing file output and supporting CSV/JSON formats.

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?

The description clearly implies when to use this tool: for large datasets needing disk streaming without row-count limits. It does not explicitly name alternatives like 'query' or specify when not to use it, but the intended context is evident.

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