Skip to main content
Glama
suthio

Redash MCP Server

by suthio

list_query_snippets

Retrieve all reusable query snippets to quickly find and reuse SQL fragments in Redash.

Instructions

List all reusable query snippets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function 'listQuerySnippets' that implements the tool logic. It calls redashClient.getQuerySnippets() and returns the list of all query snippets as JSON text.
    async function listQuerySnippets() {
      try {
        const result = await redashClient.getQuerySnippets();
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error listing query snippets: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error listing query snippets: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • No input schema is needed for this tool (no parameters, no Zod schema defined). The tool takes no arguments.
    // Tool: list_query_snippets
  • src/index.ts:2223-2230 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name 'list_query_snippets' with description and empty inputSchema.
    {
      name: "list_query_snippets",
      description: "List all reusable query snippets",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • src/index.ts:2534-2536 (registration)
    Tool dispatch in CallToolRequestSchema switch case routing 'list_query_snippets' to the listQuerySnippets handler.
    case "list_query_snippets":
      logger.debug(`Handling list_query_snippets`);
      return await listQuerySnippets();
  • Supporting API method 'getQuerySnippets' in RedashClient that makes the actual HTTP GET request to /api/query_snippets endpoint.
    async getQuerySnippets(): Promise<RedashQuerySnippet[]> {
      try {
        const response = await this.client.get('/api/query_snippets');
        return response.data;
      } catch (error) {
        logger.error(`Error fetching query snippets: ${error}`);
        throw new Error(`Failed to fetch query snippets: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior3/5

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

No annotations provided, so the description must convey behavior. It says 'List all' but doesn't mention pagination, limits, or potential large result sets. Adequate given simplicity but could be more transparent.

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?

A single sentence that efficiently conveys the tool's purpose with no unnecessary words.

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

Completeness4/5

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

Given the tool has no parameters and no output schema, the description is sufficient for a simple list operation. It could hint at return format but remains complete enough.

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?

No parameters exist; schema coverage is 100%. The description adds no parameter info beyond schema, so baseline 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 tool lists all reusable query snippets, with a specific verb and resource. It distinguishes from siblings like get_query_snippet (single) and create_query_snippet.

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

Usage Guidelines3/5

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

The description implies usage (when you need all snippets) but provides no explicit guidance on when not to use it or alternatives like get_query_snippet for a single snippet.

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