Skip to main content
Glama
suthio

Redash MCP Server

by suthio

add_query_favorite

Adds a specified query to your favorites list for quick access and organization.

Instructions

Add a query to favorites

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryIdYesID of the query to add to favorites

Implementation Reference

  • MCP tool handler function for 'add_query_favorite' - validates input with Zod schema, calls redashClient.addQueryFavorite(), and returns the result or an error.
    async function addQueryFavorite(params: z.infer<typeof addQueryFavoriteSchema>) {
      try {
        const result = await redashClient.addQueryFavorite(params.queryId);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error adding query ${params.queryId} to favorites: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error adding query ${params.queryId} to favorites: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • Zod schema for the 'add_query_favorite' tool - expects a single 'queryId' (number) parameter.
    const addQueryFavoriteSchema = z.object({
      queryId: z.coerce.number()
    });
  • src/index.ts:2139-2149 (registration)
    Tool registration in ListToolsRequestSchema - defines the tool name 'add_query_favorite', description, and input schema for MCP discovery.
    {
      name: "add_query_favorite",
      description: "Add a query to favorites",
      inputSchema: {
        type: "object",
        properties: {
          queryId: { type: "number", description: "ID of the query to add to favorites" }
        },
        required: ["queryId"]
      }
    },
  • src/index.ts:2503-2507 (registration)
    Tool dispatch in CallToolRequestSchema switch statement - routes the 'add_query_favorite' tool name to the handler function.
    case "add_query_favorite":
      logger.debug(`Handling add_query_favorite`);
      return await addQueryFavorite(addQueryFavoriteSchema.parse(args));
  • Redash API client method - sends a POST request to /api/queries/{queryId}/favorite to add a query to favorites.
    // Add query to favorites
    async addQueryFavorite(queryId: number): Promise<{ success: boolean }> {
      try {
        await this.client.post(`/api/queries/${queryId}/favorite`);
        return { success: true };
      } catch (error) {
        logger.error(`Error adding query ${queryId} to favorites: ${error}`);
        throw new Error(`Failed to add query ${queryId} to favorites: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

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

Without annotations, the description carries the full burden of behavioral disclosure, but it fails to mention whether the operation is idempotent, what happens if the query is already favorited, or any authentication requirements. The description is minimal and lacks important behavioral 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, front-loaded sentence with no extraneous information. It efficiently conveys the core purpose.

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 tool with one parameter and no output schema, the description is barely adequate. It does not explain what 'favorites' means, any limits, or the result of the operation. However, given the low complexity, it meets a minimum viable completeness.

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 already provides a description for the 'queryId' parameter ('ID of the query to add to favorites'), and the description does not add further meaning. Since schema description coverage is 100%, 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 'Add a query to favorites' uses a specific verb and resource, clearly indicating the action and target. It distinguishes itself from siblings like 'remove_query_favorite' by stating the addition operation.

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. There is no mention of prerequisites, such as whether the query should not already be favorited, or when to prefer other tools like 'remove_query_favorite' or 'get_favorite_queries'.

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