Ask with SQL · stop 3 of 5

export_query

Runs a query and formats the result as CSV, JSON or INSERT statements.

Works in read modeTool sets: query · full

You might ask

“Export last week's refunds as CSV.”

Your assistant may call export_query to answer.

How it works

  • Same read-only checks, row cap and masking as run_select.
  • sqlinsert produces INSERT statements for a target table you name, handy for copying rows into a test database.

Parameters

sqlstringrequired
A single SELECT or WITH statement to run and export.
formatstring
Output format: "csv", "json", or "sqlinsert". Default "csv".
tablestring
Target table as "schema.name", required when format="sqlinsert".

What your assistant reads

The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.

Run a read-only SELECT/WITH and format results as CSV, JSON, or SQL INSERT statements. Honors max-row / max-char caps. For sqlinsert, pass table as schema.name.