Run Saved Query
Run an existing saved query by its id and get the results.
Tool: draxlr_run_saved_query
Runs an existing saved query by its id and returns the resulting rows — using the query's own definition and saved settings. Works for both query types: raw SQL queries and query-builder queries (see query types below). To run ad-hoc SQL instead, use Run Query. Get a queryId from List Saved Queries or Get Query.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
queryId | string | Yes | The saved query id to run (from List Saved Queries or Get Query) |
databaseId | string | No | The database the query belongs to. Resolved from the query automatically if omitted |
page | integer | No | Page number for pagination (default 1) |
pageSize | integer | No | Rows per page (default 25) |
Query types
Draxlr saved queries come in two forms, and this tool handles both automatically:
- Raw — written as SQL (has a
rawQuery). These are what an assistant generates. - Builder — built visually in the Draxlr UI (no SQL; based on a table). These are identified by a
tableIdand run against a different endpoint under the hood.
The tool inspects the saved query and routes to the correct engine for you, so you only need the queryId.
Example
"Run my saved 'Orders by status' query."
Arguments:
{
"queryId": "6690aa11bc2e4a0012cd77ee"
}
Response
{
"queryId": "6690aa11bc2e4a0012cd77ee",
"type": "raw",
"url": "https://app.draxlr.com/explore/665f1c2a9b1e4a0012ab34cd/6690aa11bc2e4a0012cd77ee",
"rowCount": 3,
"columns": ["status", "orders"],
"rows": [
{ "status": "completed", "orders": 812 },
{ "status": "pending", "orders": 143 },
{ "status": "cancelled", "orders": 29 }
]
}
| Field | Description |
|---|---|
queryId | Id of the saved query that was run |
type | raw (SQL) or builder (built in the Draxlr UI) |
url | A link to view the query in Draxlr |
rowCount | Number of rows returned on this page |
columns | Column names in the result |
rows | The result rows |
Read-only only:
Only read (SELECT) queries can be run. Non-read statements are rejected.