Skip to main content
Glama
bpamiri

SQL Server MCP

by bpamiri

export_to_csv

Execute SQL queries and save results as CSV files for data analysis or sharing. Specify query, filename, and delimiter to export database records.

Instructions

Export query results to a CSV file.

Args:
    query: SQL SELECT query to execute
    filename: Output filename (relative or absolute path)
    delimiter: Field delimiter (default: comma)

Returns:
    Dictionary with:
    - status: 'success' or error
    - path: Absolute path to created file
    - row_count: Number of rows exported
    - file_size: Size of created file in bytes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
filenameYes
delimiterNo,

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool executes a SQL SELECT query and creates a file, but lacks details on permissions, error handling, file overwriting behavior, or rate limits. It adds some context (e.g., default delimiter) but is incomplete for a mutation tool.

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

Conciseness5/5

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

The description is well-structured and front-loaded with the core purpose, followed by organized sections for arguments and returns. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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?

Given the tool's complexity (mutation with file creation) and no annotations, the description is fairly complete but has gaps. It explains parameters and return values (with an output schema implied), but lacks details on behavioral aspects like error conditions or side effects, which are important for a write operation.

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 description coverage is 0%, so the description must compensate. It explicitly documents all three parameters ('query', 'filename', 'delimiter'), including the default value for 'delimiter' and clarifies that 'filename' can be relative or absolute. This adds significant meaning beyond the bare schema.

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 specific action ('Export query results to a CSV file') and distinguishes it from siblings like 'export_to_json' by specifying the output format. It identifies the resource (query results) and the output (CSV file), making the purpose unambiguous.

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 implies usage for exporting SQL query results to CSV, with no explicit guidance on when to use this versus alternatives like 'export_to_json' or other data manipulation tools. It provides clear context but lacks explicit exclusions or comparisons to sibling tools.

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/bpamiri/pymssql-mcp'

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