Skip to main content
Glama
suthio

Redash MCP Server

by suthio

archive_query

Archive a Redash query by its ID to soft-delete it, removing it from active use while preserving data for potential recovery.

Instructions

Archive (soft-delete) a query in Redash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryIdYesID of the query to archive

Implementation Reference

  • Handler function for the archive_query tool. Calls redashClient.archiveQuery(queryId) and returns the result as JSON content.
    async function archiveQuery(params: z.infer<typeof archiveQuerySchema>) {
      try {
        const { queryId } = params;
        const result = await redashClient.archiveQuery(queryId);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        logger.error(`Error archiving query ${params.queryId}: ${error}`);
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error archiving query ${params.queryId}: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema for archive_query tool input validation. Expects a single required parameter: queryId (coerced number).
    // Tool: archive_query
    const archiveQuerySchema = z.object({
      queryId: z.coerce.number()
    });
  • src/index.ts:1665-1675 (registration)
    Registration of the archive_query tool in the ListToolsRequestSchema handler. Defines name, description, and inputSchema with required queryId (number).
    {
      name: "archive_query",
      description: "Archive (soft-delete) a query in Redash",
      inputSchema: {
        type: "object",
        properties: {
          queryId: { type: "number", description: "ID of the query to archive" }
        },
        required: ["queryId"]
      }
    },
  • Helper/API client method that performs the actual HTTP DELETE request to /api/queries/{queryId} to archive (soft-delete) a query in Redash.
    // Archive (soft delete) a query
    async archiveQuery(queryId: number): Promise<{ success: boolean }> {
      try {
        logger.debug(`Archiving query ${queryId}`);
        await this.client.delete(`/api/queries/${queryId}`);
        logger.debug(`Archived query ${queryId}`);
        return { success: true };
      } catch (error) {
        logger.error(`Error archiving query ${queryId}: ${error}`);
        throw new Error(`Failed to archive query ${queryId}: ${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. 'Soft-delete' implies non-permanent deletion, but lacks details on reversibility, side effects, or permissions.

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?

Single sentence, no unnecessary words. Front-loaded with the action and resource.

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 single-parameter tool, the description is adequate but could benefit from noting implications (e.g., if it affects associated resources). No output schema, so return info is missing.

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 documents queryId. The description adds no extra meaning beyond the schema, but meets the baseline.

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 verb 'archive' (soft-delete) and resource 'a query in Redash'. It distinguishes from sibling tools like archive_dashboard and delete_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 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, no prerequisites, or conditions 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