Skip to main content
Glama
suthio

Redash MCP Server

by suthio

delete_query_snippet

Removes a specified query snippet from Redash by providing its ID. Clean up unused or outdated snippets to maintain organization.

Instructions

Delete a query snippet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
snippetIdYesID of the snippet to delete

Implementation Reference

  • The MCP tool handler function 'deleteQuerySnippet' that executes the delete_query_snippet tool logic. It parses the snippetId from input, calls redashClient.deleteQuerySnippet(), and returns success or error response.
    // Tool: delete_query_snippet
    const deleteQuerySnippetSchema = z.object({
      snippetId: z.coerce.number()
    });
    
    async function deleteQuerySnippet(params: z.infer<typeof deleteQuerySnippetSchema>) {
      try {
        const result = await redashClient.deleteQuerySnippet(params.snippetId);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error deleting query snippet ${params.snippetId}: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error deleting query snippet ${params.snippetId}: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • Zod schema for validating the delete_query_snippet tool's input parameters. Requires a numeric 'snippetId'.
    const deleteQuerySnippetSchema = z.object({
      snippetId: z.coerce.number()
    });
  • src/index.ts:2269-2279 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the 'delete_query_snippet' tool's name, description, and input JSON Schema.
    {
      name: "delete_query_snippet",
      description: "Delete a query snippet",
      inputSchema: {
        type: "object",
        properties: {
          snippetId: { type: "number", description: "ID of the snippet to delete" }
        },
        required: ["snippetId"]
      }
    },
  • src/index.ts:2550-2552 (registration)
    The switch-case routing that dispatches incoming 'delete_query_snippet' tool calls to the handler function.
    case "delete_query_snippet":
      logger.debug(`Handling delete_query_snippet`);
      return await deleteQuerySnippet(deleteQuerySnippetSchema.parse(args));
  • The client-side helper method that performs the actual HTTP DELETE request to the Redash API to delete a query snippet.
    // Delete a query snippet
    async deleteQuerySnippet(snippetId: number): Promise<{ success: boolean }> {
      try {
        await this.client.delete(`/api/query_snippets/${snippetId}`);
        return { success: true };
      } catch (error) {
        logger.error(`Error deleting query snippet ${snippetId}: ${error}`);
        throw new Error(`Failed to delete query snippet ${snippetId}: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits such as irreversibility or permission requirements. It only says 'delete', which implies destruction but does not confirm permanence or side effects.

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, short sentence that is front-loaded and contains no fluff. However, it is overly minimal and could benefit from a bit more context without being verbose.

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 delete operation with one parameter, the description is minimally complete. However, it lacks details on return values, error scenarios, or prerequisites that would aid an agent in execution.

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?

The input schema provides 100% coverage for the single parameter 'snippetId' with a description. The tool description adds no additional meaning beyond what the schema already specifies.

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 'delete' and the resource 'query snippet', making the purpose unambiguous. However, it does not differentiate from similar sibling tools like 'archive_query' or 'delete_alert' but that is not necessary given the distinct resource type.

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 on when to use this tool versus alternatives (e.g., archiving vs deleting). The description simply states the action without context or prerequisites.

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