Skip to main content
Glama
suthio

Redash MCP Server

by suthio

get_alert_subscriptions

Retrieve all subscriptions for a specified alert to manage notification recipients.

Instructions

Get all subscriptions for an alert

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alertIdYesID of the alert

Implementation Reference

  • src/index.ts:2052-2061 (registration)
    Tool registration in ListToolsRequestSchema handler - defines the tool named 'get_alert_subscriptions' with description and input schema requiring alertId
      name: "get_alert_subscriptions",
      description: "Get all subscriptions for an alert",
      inputSchema: {
        type: "object",
        properties: {
          alertId: { type: "number", description: "ID of the alert" }
        },
        required: ["alertId"]
      }
    },
  • Handler function for get_alert_subscriptions tool. Defines the Zod schema (getAlertSubscriptionsSchema) with alertId (coerced number), and the async handler that calls redashClient.getAlertSubscriptions() and returns JSON results.
    // Tool: get_alert_subscriptions
    const getAlertSubscriptionsSchema = z.object({
      alertId: z.coerce.number()
    });
    
    async function getAlertSubscriptions(params: z.infer<typeof getAlertSubscriptionsSchema>) {
      try {
        const result = await redashClient.getAlertSubscriptions(params.alertId);
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        logger.error(`Error getting alert ${params.alertId} subscriptions: ${error}`);
        return {
          isError: true,
          content: [{ type: "text", text: `Error getting alert ${params.alertId} subscriptions: ${error instanceof Error ? error.message : String(error)}` }]
        };
      }
    }
  • src/index.ts:2471-2473 (registration)
    Tool dispatch in CallToolRequestSchema handler - routes 'get_alert_subscriptions' to getAlertSubscriptions() with parsed args
    case "get_alert_subscriptions":
      logger.debug(`Handling get_alert_subscriptions`);
      return await getAlertSubscriptions(getAlertSubscriptionsSchema.parse(args));
  • Client helper method - makes GET request to /api/alerts/{alertId}/subscriptions to fetch alert subscriptions from the Redash API
    async getAlertSubscriptions(alertId: number): Promise<AlertSubscription[]> {
      try {
        const response = await this.client.get(`/api/alerts/${alertId}/subscriptions`);
        return response.data;
      } catch (error) {
        logger.error(`Error fetching alert ${alertId} subscriptions: ${error}`);
        throw new Error(`Failed to fetch alert ${alertId} subscriptions: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • AlertSubscription type definition - interface with id, alert_id, user, and destination fields
    export interface AlertSubscription {
      id: number;
      alert_id: number;
      user?: {
        id: number;
        name: string;
        email: string;
      };
      destination?: {
        id: number;
        name: string;
        type: string;
      };
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states what the tool does but does not confirm read-only behavior, potential side effects, or any restrictions. For a retrieval operation, this is a minor gap but still insufficient.

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 focused sentence with no unnecessary words, directly conveying the tool's 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?

The description is sufficient for a simple retrieval tool with one parameter, but it lacks any mention of the return format or behavior, which would be helpful given no output schema.

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 description implies the parameter role, but it adds no new meaning beyond the schema's description 'ID of the alert'. Baseline score due to high coverage.

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 'Get all subscriptions for an alert' clearly states the action and resource, differentiating it from sibling tools like add_alert_subscription and remove_alert_subscription.

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?

No usage guidelines are provided. While the tool's purpose is straightforward, there is no guidance on when to use this vs. other subscription-related tools, such as add_alert_subscription or remove_alert_subscription.

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