Export Query
Export a saved query's results as a CSV or Excel file.
Tool: draxlr_export_query
Exports a saved query's results as a CSV or Excel (.xlsx) file. Works for both query types — raw SQL queries and query-builder queries (the tool detects which and exports accordingly). The tool returns a short-lived downloadUrl (valid for 5 minutes) that you open in your browser to download the file. Get a queryId from List Saved Queries or Get Query.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
queryId | string | Yes | The saved query id to export (from List Saved Queries or Get Query) |
format | string | No | Export format: csv (default) or xlsx |
Example
"Export my 'Monthly revenue' query as an Excel file."
Arguments:
{
"queryId": "6690ab42bc2e4a0012cd8123",
"format": "xlsx"
}
Response
{
"message": "Your export is ready. Open this link to download query-6690ab42bc2e4a0012cd8123.xlsx (the link expires in 5 minutes):",
"downloadUrl": "https://api.draxlr.com/mcp/download/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"fileName": "query-6690ab42bc2e4a0012cd8123.xlsx",
"queryId": "6690ab42bc2e4a0012cd8123",
"format": "xlsx"
}
| Field | Description |
|---|---|
message | A human-readable summary, including how long the link is valid |
downloadUrl | A short-lived link (valid for 5 minutes) to download the file |
fileName | The name the downloaded file will be saved as |
queryId | The saved query that was exported |
format | The format the file was exported in |
Read-only only:
Only read (SELECT) queries can be exported. Non-read statements are rejected.