Skip to main content
Glama
suthio

Redash MCP Server

by suthio

get_query

Retrieve detailed information about a specific query by providing its ID. Ideal for query management and troubleshooting.

Instructions

Get details of a specific query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryIdYesID of the query to get

Implementation Reference

  • src/index.ts:1617-1627 (registration)
    Tool 'get_query' is registered with the MCP ListToolsRequestSchema, defining its name, description, and input schema (queryId number required).
    {
      name: "get_query",
      description: "Get details of a specific query",
      inputSchema: {
        type: "object",
        properties: {
          queryId: { type: "number", description: "ID of the query to get" }
        },
        required: ["queryId"]
      }
    },
  • Zod schema for get_query validation: accepts queryId as a coerced number.
    const getQuerySchema = z.object({
      queryId: z.coerce.number()
    });
  • Handler function for get_query. Calls redashClient.getQuery(queryId) and returns the JSON-stringified result, or an error message on failure.
    async function getQuery(params: z.infer<typeof getQuerySchema>) {
      try {
        const { queryId } = params;
        const query = await redashClient.getQuery(queryId);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(query, null, 2)
            }
          ]
        };
      } catch (error) {
        logger.error(`Error getting query ${params.queryId}: ${error}`);
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error getting query ${params.queryId}: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • src/index.ts:2342-2344 (registration)
    Dispatch case in CallToolRequestSchema handler that routes 'get_query' tool calls to the getQuery function with schema validation.
    case "get_query":
      logger.debug(`Handling get_query`);
      return await getQuery(getQuerySchema.parse(args));
  • RedashClient.getQuery() - makes an HTTP GET to /api/queries/{queryId} and returns the RedashQuery data. This is the underlying API client helper.
    async getQuery(queryId: number): Promise<RedashQuery> {
      try {
        const response = await this.client.get(`/api/queries/${queryId}`);
        return response.data;
      } catch (error) {
        console.error(`Error fetching query ${queryId}:`, error);
        throw new Error(`Failed to fetch query ${queryId} from Redash`);
      }
    }
Behavior2/5

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

With no annotations, the description bears full burden for behavioral disclosure. It only states 'Get details', which hints at read-only but does not specify permissions, rate limits, or what 'details' includes. This is minimal transparency.

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?

The description is a single concise sentence with no waste. It is front-loaded and efficient, though adding minor behavioral context could improve it without losing conciseness.

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

Completeness3/5

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

For a simple read tool with one parameter and no output schema, the description is minimally adequate. It tells the agent what it does but lacks details on output format, prerequisites, or any side effects, leaving gaps.

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 schema already describes 'queryId' as 'ID of the query to get'. The description adds no extra meaning beyond what the schema provides, so baseline score of 3 is appropriate.

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?

The description clearly states the action 'Get' and the resource 'details of a specific query', which is distinct from sibling tools like 'list_queries' (collective) or 'create_query' (creation).

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

Usage Guidelines4/5

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

The description implies usage when you have a queryId and need its details, providing clear context. However, it does not explicitly state when not to use it (e.g., to list queries) or mention alternatives, but the context is sufficient for differentiation from siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/suthio/redash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server