Skip to main content
Glama
suthio

Redash MCP Server

by suthio

create_alert

Create alerts in Redash to monitor query results and get notified when specified conditions are met.

Instructions

Create a new alert in Redash. Alerts notify you when a query result meets a specified condition.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the alert
query_idYesID of the query to monitor
optionsYesAlert options including column to monitor, operator (e.g., 'greater than', 'less than', 'equals'), and threshold value
rearmNoNumber of seconds to wait before triggering again (null for never)

Implementation Reference

  • The createAlert handler function that executes the 'create_alert' tool logic. It takes validated parameters (name, query_id, options, rearm), constructs a CreateAlertRequest, and calls redashClient.createAlert().
    async function createAlert(params: z.infer<typeof createAlertSchema>) {
      try {
        const alertData: CreateAlertRequest = {
          name: params.name,
          query_id: params.query_id,
          options: params.options,
          rearm: params.rearm
        };
        const result = await redashClient.createAlert(alertData);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error creating alert: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error creating alert: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • The Zod schema for validating create_alert input parameters. Defines fields: name (string), query_id (number), options (object with column, op, value, optional custom_subject/custom_body), and optional rearm.
    const createAlertSchema = z.object({
      name: z.string(),
      query_id: z.coerce.number(),
      options: z.object({
        column: z.string(),
        op: z.string(),
        value: z.union([z.coerce.number(), z.string()]),
        custom_subject: z.string().optional(),
        custom_body: z.string().optional()
      }),
      rearm: z.coerce.number().nullable().optional()
    });
  • src/index.ts:1979-2003 (registration)
    Registration of the 'create_alert' tool in the ListToolsRequestSchema handler, including its description and input schema for MCP tool discovery.
    {
      name: "create_alert",
      description: "Create a new alert in Redash. Alerts notify you when a query result meets a specified condition.",
      inputSchema: {
        type: "object",
        properties: {
          name: { type: "string", description: "Name of the alert" },
          query_id: { type: "number", description: "ID of the query to monitor" },
          options: {
            type: "object",
            description: "Alert options including column to monitor, operator (e.g., 'greater than', 'less than', 'equals'), and threshold value",
            properties: {
              column: { type: "string", description: "Column name to monitor" },
              op: { type: "string", description: "Comparison operator: 'greater than', 'less than', 'equals', 'not equals', etc." },
              value: { type: ["number", "string"], description: "Threshold value to compare against" },
              custom_subject: { type: "string", description: "Custom email subject" },
              custom_body: { type: "string", description: "Custom email body" }
            },
            required: ["column", "op", "value"]
          },
          rearm: { type: ["number", "null"], description: "Number of seconds to wait before triggering again (null for never)" }
        },
        required: ["name", "query_id", "options"]
      }
    },
  • src/index.ts:2455-2457 (registration)
    Dispatch handler in CallToolRequestSchema that routes the 'create_alert' tool call to the createAlert function with validated args.
    case "create_alert":
      logger.debug(`Handling create_alert`);
      return await createAlert(createAlertSchema.parse(args));
  • The CreateAlertRequest interface used as data contract for the API call in redashClient.createAlert().
    export interface CreateAlertRequest {
      name: string;
      query_id: number;
      options: {
        column: string;
        op: string;
        value: number | string;
        custom_subject?: string;
        custom_body?: string;
      };
      rearm?: number | null;
    }
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It only states it creates an alert and that alerts notify. It doesn't mention side effects (e.g., triggering subscriptions, permission requirements) or any constraints. Insufficient for a creation tool.

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?

Two sentences with no wasted words. Front-loaded with the primary action. Efficient and to the point.

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?

Despite having nested parameters and no output schema, the description is minimal. It does not explain return behavior (e.g., returns the created alert object), required relationships (e.g., query_id must exist), or error conditions. Inadequate for a complex tool.

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%, so the schema fully documents parameters. The description adds no extra meaning beyond the schema; it merely restates the purpose. Baseline of 3 is appropriate as it doesn't detract but doesn't add value.

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 action ('Create a new alert') and the resource ('in Redash'), distinguishing it from sibling tools like update_alert or delete_alert. The added detail about alerts notifying on query conditions provides context.

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 versus alternatives like update_alert or mute_alert. No mention of prerequisites or when not to use it. Simply describes the action without usage context.

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