Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by berthojoris

export_query_to_csv

Read-onlyIdempotent

Execute a SELECT query and export its result set to CSV format. Use it to turn JOINs, aggregations, or parameterized reads into CSV files with optional column headers.

Instructions

📄 Executes a SELECT query and exports results to CSV format. Requires both utility and read permissions. Supports complex queries with JOINs and aggregations.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "export_query_to_csv"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSQL SELECT query to execute and export
paramsNoOptional array of parameters for parameterized queries
include_headersNoWhether to include column headers in the CSV output

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.46.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the safety profile is covered elsewhere. The description adds real value with the permission requirement and the note that JOINs and aggregations are supported, but it omits where the CSV lands (file path, returned blob, download link) and any size or row limits, which matter for an export operation.

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?

Three short sentences, front-loaded with the core action and with zero filler. The leading emoji is decorative but harmless; the rest of the text earns its place.

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

Completeness3/5

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

There is no output schema, and the description does not explain the shape of the result — whether the CSV is written to a path, streamed back, or summarized. For an export tool with three parameters and no return documentation, that is a meaningful omission, though the query-scoping and permission facts are adequately covered.

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 all three parameters (query, params, include_headers) are already documented in the schema. The description adds no syntax, formatting, or default-value guidance beyond that, so the baseline of 3 applies.

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?

The description names a specific verb+resource pair: execute a SELECT query and export the results to CSV. That is far more specific than the name alone, though it does not explicitly differentiate itself from sibling tools like export_table_to_csv or run_select_query.

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?

Usage is implied by the SELECT-only scope and the permission prerequisite ('Requires both utility and read permissions'), which is genuinely useful context. However, it never states when to pick this over export_table_to_csv (whole-table export) or run_select_query (no export), leaving the routing decision to inference.

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