Skip to main content
Glama

get_query

Read-only

Retrieve a saved Redash query's full definition, including SQL text, parameters, owner, tags, and visualization IDs for dashboard placement.

Instructions

Get the full definition of a saved query. Behavior: returns the query's SQL text, data_source_id, tags, owner, update time, its parameters (name, type, default value, dropdown options), and its visualizations (each with id, name, type). Usage: find the query_id with list_queries. The returned visualization ids can be placed on a dashboard with add_widget; to actually run the query use get_query_result.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
query_idYesID of the saved query to inspect (from list_queries)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.0
    • changedInput schema / properties / query_id / description
      Previous value: -"Query ID (from list_queries)"New value: +"ID of the saved query to inspect (from list_queries)"
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With readOnlyHint already declaring the safety profile, the description adds real value by enumerating exactly what is returned (SQL text, data_source_id, tags, owner, update time, parameters with name/type/default/options, and visualizations with id/name/type). It doesn't mention permissions or size/rate considerations, but for a read-only fetch that is a minor omission.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three labeled sentences (definition, Behavior, Usage), front-loaded with purpose and wasting nothing. The parenthetical field lists are dense but each entry tells the agent what to expect in the response.

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 carries the return-value burden and does so thoroughly by listing every top-level and nested field. Combined with the routing guidance, an agent has everything needed to call this correctly and interpret the result.

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 coverage is 100% and the single query_id parameter is already documented there, including the '(from list_queries)' provenance hint. The description restates that provenance without adding format or edge-case detail, so the schema does the heavy lifting and the baseline of 3 applies.

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?

States a specific verb and resource ('Get the full definition of a saved query') and immediately scopes what 'definition' means. This clearly distinguishes it from siblings like get_query_result (execution) and list_queries (enumeration).

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?

Explicitly routes the agent: obtain query_id via list_queries, use get_query_result to actually run the query, and use add_widget to place the returned visualization ids on a dashboard. Both the prerequisite and the two most likely alternative tools are named with clear conditions.

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