Skip to main content
Glama
suthio

Redash MCP Server

by suthio

list_queries

Retrieve a paginated, searchable list of all queries in Redash. Use search and page parameters to find specific queries.

Instructions

List all available queries in Redash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (starts at 1)
pageSizeNoNumber of results per page
qNoSearch query

Implementation Reference

  • The main handler function for the 'list_queries' tool. It accepts validated params (page, pageSize, q), calls redashClient.getQueries(), and returns the JSON response.
    async function listQueries(params: z.infer<typeof listQueriesSchema>) {
      try {
        const { page, pageSize, q } = params;
        const queries = await redashClient.getQueries(page, pageSize, q);
    
        logger.debug(`Listed ${queries.results.length} queries`);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(queries, null, 2)
            }
          ]
        };
      } catch (error) {
        logger.error(`Error listing queries: ${error}`);
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error listing queries: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema for validating input parameters of the 'list_queries' tool. Accepts optional page (default 1), pageSize (default 25), and q (search query string).
    const listQueriesSchema = z.object({
      page: z.coerce.number().optional().default(1),
      pageSize: z.coerce.number().optional().default(25),
      q: z.string().optional()
    });
  • src/index.ts:1606-1616 (registration)
    The tool is registered in the ListToolsRequestSchema handler with name 'list_queries', description, and inputSchema defining page, pageSize, and q parameters.
      name: "list_queries",
      description: "List all available queries in Redash",
      inputSchema: {
        type: "object",
        properties: {
          page: { type: "number", description: "Page number (starts at 1)" },
          pageSize: { type: "number", description: "Number of results per page" },
          q: { type: "string", description: "Search query" }
        }
      }
    },
  • src/index.ts:2338-2340 (registration)
    In the CallToolRequestSchema handler, the 'list_queries' case calls listQueries() with parsed schema arguments.
    case "list_queries":
      logger.debug(`Handling list_queries`);
      return await listQueries(listQueriesSchema.parse(args));
  • The getQueries() method on RedashClient that makes the actual HTTP GET request to /api/queries with page, page_size, and q params. This is called by the listQueries handler.
    async getQueries(page = 1, pageSize = 25, q?: string): Promise<{ count: number; page: number; pageSize: number; results: RedashQuery[] }> {
      try {
        const response = await this.client.get('/api/queries', {
          params: { page, page_size: pageSize, q }
        });
    
        return {
          count: response.data.count,
          page: response.data.page,
          pageSize: response.data.page_size,
          results: response.data.results
        };
      } catch (error) {
        logger.error(`Error fetching queries: ${error}`);
        throw new Error('Failed to fetch queries from Redash');
      }
    }
Behavior2/5

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

No annotations provided; description fails to disclose behavioral traits such as pagination behavior, sorting order, or whether all queries are returned regardless of user permissions. It carries the full burden but offers minimal information beyond the name.

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 wasted words. However, it could be structured to include more useful information without verbosity.

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

Completeness2/5

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

Given the lack of output schema and the presence of similar sibling tools (e.g., list_dashboards, get_query), the description is incomplete. It omits pagination defaults, search behavior, and result ordering, which are important for proper usage.

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% with basic parameter descriptions. The tool description adds no additional meaning beyond the schema, so the 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 explicitly states 'List all available queries in Redash', using a clear verb and resource. It distinguishes from siblings like get_query (single query) and get_recent_queries (recent only).

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives like get_query, get_favorite_queries, or search-related tools. No exclusions or context provided.

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