Skip to main content
Glama
jasonsmithj

Redash MCP Server

by jasonsmithj

list_queries

Retrieve and display all queries stored in Redash for review and management, with pagination support for large datasets.

Instructions

List all queries in Redash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default: 1)
page_sizeNoNumber of results per page (default: 25)

Implementation Reference

  • Complete implementation of the 'list_queries' tool, including name, description, input schema, and handler function that paginates and fetches queries via Redash client.
    export const listQueriesTool: Tool = {
      name: 'list_queries',
      description: 'List all queries in Redash',
      inputSchema: {
        type: 'object',
        properties: {
          page: {
            type: 'number',
            description: 'Page number (default: 1)',
            minimum: 1,
          },
          page_size: {
            type: 'number',
            description: 'Number of results per page (default: 25)',
            minimum: 1,
            maximum: 100,
          },
        },
        additionalProperties: false,
      },
      handler: async (args, client) => {
        try {
          const page = typeof args.page === 'number' ? args.page : 1;
          const pageSize = typeof args.page_size === 'number' ? args.page_size : 25;
    
          const queries = await client.listQueries(page, pageSize);
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(queries, null, 2),
              } as TextContent,
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error listing queries: ${error instanceof Error ? error.message : String(error)}`,
              } as TextContent,
            ],
            isError: true,
          };
        }
      },
    };
  • Input schema defining optional pagination parameters for the list_queries tool.
    inputSchema: {
      type: 'object',
      properties: {
        page: {
          type: 'number',
          description: 'Page number (default: 1)',
          minimum: 1,
        },
        page_size: {
          type: 'number',
          description: 'Number of results per page (default: 25)',
          minimum: 1,
          maximum: 100,
        },
      },
      additionalProperties: false,
    },
  • src/index.ts:59-59 (registration)
    Registration of listQueriesTool in the main tools array used by MCP server handlers.
    const tools = [listDataSourcesTool, getDataSourceTool, executeQueryAndWaitTool, listQueriesTool];
  • src/index.ts:17-17 (registration)
    Import of listQueriesTool into the main index file.
    import { executeQueryAndWaitTool, listQueriesTool } from './tools/query.js';
  • RedashClient method that performs the API request to list queries, used by the tool handler.
    async listQueries(page = 1, pageSize = 25): Promise<Query[]> {
      const response = await this.request<{ results: Query[] }>(
        `/api/queries?page=${page}&page_size=${pageSize}`
      );
      return response.results;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'List all queries' implies a read-only operation, but it doesn't mention pagination behavior, rate limits, authentication requirements, or what 'all queries' encompasses (e.g., visibility permissions). The description is minimal and lacks important operational context.

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?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple list operation and gets straight to the point without unnecessary elaboration.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the output contains (query metadata, IDs, names), how pagination works in practice, or any limitations. The agent would need to guess about the return format and operational behavior.

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 description coverage is 100%, so the schema fully documents both parameters (page and page_size) with defaults and constraints. The description adds no parameter information beyond what's in the schema, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and target resource ('all queries in Redash'), making the purpose immediately understandable. It doesn't distinguish from sibling tools like 'list_data_sources', but the verb+resource combination is specific enough for basic understanding.

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 is provided about when to use this tool versus alternatives like 'execute_query_and_wait' or 'get_data_source'. The description doesn't mention any prerequisites, context, or exclusions for usage.

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/jasonsmithj/redash-mcp'

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