Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_create_alert_rule

Create custom alert rules for Sentry projects to monitor errors and performance issues, enabling automated notifications and actions based on defined conditions.

Instructions

Create an alert rule for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectSlugYesProject slug/identifier
nameYesAlert rule name
conditionsNoAlert conditions
actionsNoAlert actions
frequencyNoCheck frequency in minutes

Implementation Reference

  • MCP tool handler for 'sentry_create_alert_rule'. Extracts arguments, constructs alert rule with defaults, calls SentryAPIClient.createAlertRule, and returns confirmation.
    case "sentry_create_alert_rule": {
      if (!apiClient) {
        throw new Error("Sentry API client not initialized. Provide auth token.");
      }
      
      const { projectSlug, name, conditions = [], actions = [], frequency } = args as any;
      
      // Default alert rule if not provided
      const rule = {
        name,
        conditions: conditions.length > 0 ? conditions : [
          {
            id: 'sentry.rules.conditions.first_seen_event.FirstSeenEventCondition',
          }
        ],
        actions: actions.length > 0 ? actions : [
          {
            id: 'sentry.rules.actions.notify_event.NotifyEventAction',
          }
        ],
        actionMatch: 'all',
        frequency: frequency || 30,
      };
      
      const createdRule = await apiClient.createAlertRule(projectSlug, rule);
      
      return {
        content: [
          {
            type: "text",
            text: `Alert rule created: ${createdRule.name} for project ${projectSlug}`,
          },
        ],
      };
    }
  • Input schema and registration for the 'sentry_create_alert_rule' tool in the MCP server's tool list.
    {
      name: "sentry_create_alert_rule",
      description: "Create an alert rule for a project",
      inputSchema: {
        type: "object",
        properties: {
          projectSlug: {
            type: "string",
            description: "Project slug/identifier",
          },
          name: {
            type: "string",
            description: "Alert rule name",
          },
          conditions: {
            type: "array",
            description: "Alert conditions",
          },
          actions: {
            type: "array",
            description: "Alert actions",
          },
          frequency: {
            type: "number",
            description: "Check frequency in minutes",
            default: 30,
          },
        },
        required: ["projectSlug", "name"],
      },
    },
  • SentryAPIClient helper method that sends POST request to Sentry API endpoint to create the alert rule.
    async createAlertRule(projectSlug: string, rule: any) {
      return this.request(`/projects/${this.org}/${projectSlug}/rules/`, {
        method: 'POST',
        body: JSON.stringify(rule),
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create' implies a write/mutation operation, but the description doesn't disclose important behavioral traits: whether this requires specific permissions, what happens on success/failure, if there are rate limits, or what the return value contains. It mentions nothing about the alert rule lifecycle or system impact.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a creation tool and front-loads the essential information. Every word earns its place.

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?

For a creation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address what happens after creation, error conditions, or system constraints. The agent lacks context about the alert rule's purpose within Sentry or how it integrates with other tools. The description should provide more operational context given the tool's complexity.

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 description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema - it doesn't explain what constitutes valid 'conditions' or 'actions', or provide examples. With complete schema coverage, 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('alert rule for a project'), providing specific verb+resource pairing. It distinguishes this from sibling tools like sentry_create_project or sentry_create_release by specifying the alert rule resource type. However, it doesn't explicitly differentiate from all possible alert-related tools (though none exist in the sibling list).

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing project), when not to use it, or what other tools might be more appropriate for related tasks. The agent must infer usage from the tool name alone.

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/diegofornalha/sentry-mcp-cursor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server