Skip to main content
Glama

get_query_result

Read-only

Run a saved Redash query by ID and return its latest results as a markdown table or JSON, with optional parameters, row limits, and timeout control.

Instructions

Run an existing saved query by its ID and return the latest results. Behavior: executes the query as stored in Redash and returns up to max_rows rows as a markdown table or JSON, with the column list and a truncation note. Usage: find the query_id with list_queries or get_query. If the query has parameters ({{ name }} placeholders), call get_query first to see their names, types, and allowed values, then pass every one in parameters — Redash does not fill in defaults for API calls. Unlike run_query, this executes already-saved SQL rather than ad-hoc SQL, so the safety guard does not apply.

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_id": "<query_id>"
    },
    "name": "get_query_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoOutput format: table (markdown) or jsontable
max_rowsNoMax rows to return (1 to 10000, default 100)
query_idYesID of the saved query to run (from list_queries)
parametersNoValues for the query's parameters, keyed by parameter name (from get_query). Text/date: string; number: number; multi-select dropdown: array; date range: {start, end} (e.g. {"start": "2026-10-01", "end": "2026-10-15"})
timeout_secsNoQuery execution timeout in seconds (1 to 300, default 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.5.0
    • addedInput schema / properties / parameters
      Added value: +{
      +  "additionalProperties": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "items": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "number"
      +            }
      +          ]
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "properties": {
      +          "end": {
      +            "type": "string"
      +          },
      +          "start": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "start",
      +          "end"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "description": "Values for the query's parameters, keyed by parameter name (from get_query). Text/date: string; number: number; multi-select dropdown: array; date range: {start, end} (e.g. {\"start\": \"2026-10-01\", \"end\": \"2026-10-15\"})",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. Changed1 schema field changedv3.2.0
    • changedInput schema / properties / query_id / description
      Previous value: -"Saved query ID (from list_queries)"New value: +"ID of the saved query to run (from list_queries)"
  3. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation it discloses execution semantics that matter: results are truncated at max_rows with a visible truncation note, output is a markdown table or JSON with a column list, Redash does not apply parameter defaults on API calls, and the ad-hoc safety guard does not apply here. These are exactly the non-obvious traits an agent needs before invoking.

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?

Purpose comes first, then Behavior, then Usage, so it is well front-loaded. It is dense with semicolons and parentheticals but each clause (truncation note, no defaults, guard exemption) carries real information, so the length is earned.

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

Completeness5/5

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

There is no output schema, so the description supplies the return shape (table or JSON, column list, truncation note) itself. For a 5-parameter tool with nested parameter objects it leaves no significant gap for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; the description still adds meaning by warning that every parameter must be supplied because defaults are not filled, and by linking parameter names to get_query. The date-range/array shapes are left to the schema, which is fine given full coverage.

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?

Opens with a specific verb and resource ('Run an existing saved query by its ID and return the latest results') and explicitly distinguishes itself from run_query ('executes already-saved SQL rather than ad-hoc SQL'). An agent can pick between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete routing: use list_queries or get_query to find the query_id, call get_query first when placeholders exist, then pass every parameter. It also names run_query as the alternative for ad-hoc SQL, covering both when-to-use and when-not-to-use.

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