Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_capture_message

Send custom messages to Sentry for monitoring application events, errors, and performance issues with configurable severity levels and contextual data.

Instructions

Capture and send a message to Sentry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to Sentry
levelNoSeverity level of the messageinfo
tagsNoKey-value pairs to tag the message
contextNoAdditional context data

Implementation Reference

  • The main handler logic for the sentry_capture_message tool. Uses Sentry.withScope to configure level, tags, and context before calling Sentry.captureMessage.
    case "sentry_capture_message": {
      const { message, level = "info", tags, context } = args as any;
      
      Sentry.withScope((scope) => {
        scope.setLevel(mapSeverityLevel(level));
        
        if (tags) {
          Object.entries(tags).forEach(([key, value]) => {
            scope.setTag(key, value as string);
          });
        }
        
        if (context) {
          Object.entries(context).forEach(([key, value]) => {
            scope.setContext(key, value as any);
          });
        }
        
        Sentry.captureMessage(message, mapSeverityLevel(level));
      });
      
      return {
        content: [
          {
            type: "text",
            text: `Message captured: ${message}`,
          },
        ],
      };
    }
  • Input schema definition for the sentry_capture_message tool, specifying parameters like message, level, tags, and context.
      name: "sentry_capture_message",
      description: "Capture and send a message to Sentry",
      inputSchema: {
        type: "object",
        properties: {
          message: {
            type: "string",
            description: "Message to send to Sentry",
          },
          level: {
            type: "string",
            enum: ["fatal", "error", "warning", "info", "debug"],
            description: "Severity level of the message",
            default: "info",
          },
          tags: {
            type: "object",
            description: "Key-value pairs to tag the message",
            additionalProperties: { type: "string" },
          },
          context: {
            type: "object",
            description: "Additional context data",
            additionalProperties: true,
          },
        },
        required: ["message"],
      },
    },
  • src/index.ts:93-691 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, where the tool list including sentry_capture_message is returned.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "sentry_capture_exception",
            description: "Capture and send an exception to Sentry",
            inputSchema: {
              type: "object",
              properties: {
                error: {
                  type: "string",
                  description: "Error message or description",
                },
                level: {
                  type: "string",
                  enum: ["fatal", "error", "warning", "info", "debug"],
                  description: "Severity level of the error",
                  default: "error",
                },
                tags: {
                  type: "object",
                  description: "Key-value pairs to tag the error",
                  additionalProperties: { type: "string" },
                },
                context: {
                  type: "object",
                  description: "Additional context data",
                  additionalProperties: true,
                },
                user: {
                  type: "object",
                  description: "User information",
                  properties: {
                    id: { type: "string" },
                    email: { type: "string" },
                    username: { type: "string" },
                  },
                },
              },
              required: ["error"],
            },
          },
          {
            name: "sentry_capture_message",
            description: "Capture and send a message to Sentry",
            inputSchema: {
              type: "object",
              properties: {
                message: {
                  type: "string",
                  description: "Message to send to Sentry",
                },
                level: {
                  type: "string",
                  enum: ["fatal", "error", "warning", "info", "debug"],
                  description: "Severity level of the message",
                  default: "info",
                },
                tags: {
                  type: "object",
                  description: "Key-value pairs to tag the message",
                  additionalProperties: { type: "string" },
                },
                context: {
                  type: "object",
                  description: "Additional context data",
                  additionalProperties: true,
                },
              },
              required: ["message"],
            },
          },
          {
            name: "sentry_add_breadcrumb",
            description: "Add a breadcrumb for debugging context",
            inputSchema: {
              type: "object",
              properties: {
                message: {
                  type: "string",
                  description: "Breadcrumb message",
                },
                category: {
                  type: "string",
                  description: "Category of the breadcrumb",
                },
                level: {
                  type: "string",
                  enum: ["fatal", "error", "warning", "info", "debug"],
                  description: "Severity level",
                  default: "info",
                },
                data: {
                  type: "object",
                  description: "Additional data for the breadcrumb",
                  additionalProperties: true,
                },
              },
              required: ["message"],
            },
          },
          {
            name: "sentry_set_user",
            description: "Set user context for Sentry",
            inputSchema: {
              type: "object",
              properties: {
                id: {
                  type: "string",
                  description: "User ID",
                },
                email: {
                  type: "string",
                  description: "User email",
                },
                username: {
                  type: "string",
                  description: "Username",
                },
                ip_address: {
                  type: "string",
                  description: "User IP address",
                },
                segment: {
                  type: "string",
                  description: "User segment",
                },
              },
            },
          },
          {
            name: "sentry_set_tag",
            description: "Set a tag that will be sent with all events",
            inputSchema: {
              type: "object",
              properties: {
                key: {
                  type: "string",
                  description: "Tag key",
                },
                value: {
                  type: "string",
                  description: "Tag value",
                },
              },
              required: ["key", "value"],
            },
          },
          {
            name: "sentry_set_context",
            description: "Set custom context data",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Context name",
                },
                context: {
                  type: "object",
                  description: "Context data",
                  additionalProperties: true,
                },
              },
              required: ["name", "context"],
            },
          },
          {
            name: "sentry_start_transaction",
            description: "Start a performance monitoring transaction",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Transaction name",
                },
                op: {
                  type: "string",
                  description: "Operation type (e.g., 'http.request', 'db.query')",
                },
                description: {
                  type: "string",
                  description: "Transaction description",
                },
              },
              required: ["name", "op"],
            },
          },
          {
            name: "sentry_finish_transaction",
            description: "Finish the current transaction",
            inputSchema: {
              type: "object",
              properties: {
                status: {
                  type: "string",
                  description: "Transaction status",
                  enum: ["ok", "cancelled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal_error", "unavailable", "data_loss", "unauthenticated"],
                  default: "ok",
                },
              },
            },
          },
          {
            name: "sentry_start_session",
            description: "Start a new session for release health monitoring",
            inputSchema: {
              type: "object",
              properties: {
                distinctId: {
                  type: "string",
                  description: "Unique user identifier (ID, email, or username)",
                },
                sessionId: {
                  type: "string",
                  description: "Optional custom session ID",
                },
                release: {
                  type: "string",
                  description: "Release version",
                },
                environment: {
                  type: "string",
                  description: "Environment name (production, staging, etc)",
                },
              },
            },
          },
          {
            name: "sentry_end_session",
            description: "End the current session with a specific status",
            inputSchema: {
              type: "object",
              properties: {
                status: {
                  type: "string",
                  enum: ["exited", "crashed", "abnormal", "errored"],
                  description: "How the session ended",
                  default: "exited",
                },
              },
            },
          },
          {
            name: "sentry_set_release",
            description: "Set the release version for release health tracking",
            inputSchema: {
              type: "object",
              properties: {
                release: {
                  type: "string",
                  description: "Release version (e.g., 'myapp@1.0.0')",
                },
                dist: {
                  type: "string",
                  description: "Distribution identifier",
                },
              },
              required: ["release"],
            },
          },
          {
            name: "sentry_capture_session",
            description: "Manually capture a session for server-mode/request-mode",
            inputSchema: {
              type: "object",
              properties: {
                sessionId: {
                  type: "string",
                  description: "Unique session identifier",
                },
                distinctId: {
                  type: "string",
                  description: "User identifier",
                },
                status: {
                  type: "string",
                  enum: ["ok", "exited", "crashed", "abnormal", "errored"],
                  description: "Session status",
                  default: "ok",
                },
                duration: {
                  type: "number",
                  description: "Session duration in seconds",
                },
                errors: {
                  type: "number",
                  description: "Number of errors in session",
                  default: 0,
                },
              },
              required: ["sessionId"],
            },
          },
          // API Management Tools
          {
            name: "sentry_list_projects",
            description: "List all projects in the organization",
            inputSchema: {
              type: "object",
              properties: {},
            },
          },
          {
            name: "sentry_list_issues",
            description: "List issues for a project",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
                query: {
                  type: "string",
                  description: "Search query (e.g., 'is:unresolved', 'level:error')",
                },
              },
              required: ["projectSlug"],
            },
          },
          {
            name: "sentry_create_release",
            description: "Create a new release",
            inputSchema: {
              type: "object",
              properties: {
                version: {
                  type: "string",
                  description: "Release version (e.g., 'myapp@1.0.0')",
                },
                projects: {
                  type: "array",
                  items: { type: "string" },
                  description: "List of project slugs",
                },
                url: {
                  type: "string",
                  description: "Release URL",
                },
                dateReleased: {
                  type: "string",
                  description: "Release date (ISO format)",
                },
              },
              required: ["version"],
            },
          },
          {
            name: "sentry_list_releases",
            description: "List releases for a project",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
              },
              required: ["projectSlug"],
            },
          },
          {
            name: "sentry_get_organization_stats",
            description: "Get organization statistics",
            inputSchema: {
              type: "object",
              properties: {
                stat: {
                  type: "string",
                  enum: ["received", "rejected", "blacklisted"],
                  description: "Type of statistic",
                },
                since: {
                  type: "string",
                  description: "Start date (ISO format or timestamp)",
                },
                until: {
                  type: "string",
                  description: "End date (ISO format or timestamp)",
                },
                resolution: {
                  type: "string",
                  enum: ["10s", "1h", "1d"],
                  description: "Time resolution",
                },
              },
              required: ["stat"],
            },
          },
          {
            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"],
            },
          },
          {
            name: "sentry_resolve_short_id",
            description: "Retrieve details about an issue using its short ID. Maps short IDs to issue details, project context and status.",
            inputSchema: {
              type: "object",
              properties: {
                shortId: {
                  type: "string",
                  description: "The short ID of the issue (e.g., 'PROJ-123')",
                },
              },
              required: ["shortId"],
            },
          },
          {
            name: "sentry_get_event",
            description: "Retrieve a specific Sentry event from an issue. Requires issue ID/URL and event ID.",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
                eventId: {
                  type: "string",
                  description: "Event ID",
                },
              },
              required: ["projectSlug", "eventId"],
            },
          },
          {
            name: "sentry_list_error_events_in_project",
            description: "List error events from a specific Sentry project. View recent errors, frequency patterns and occurrence timestamps.",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
                limit: {
                  type: "number",
                  description: "Number of events to return",
                  default: 50,
                },
                query: {
                  type: "string",
                  description: "Search query",
                },
              },
              required: ["projectSlug"],
            },
          },
          {
            name: "sentry_create_project",
            description: "Create a new project in Sentry. Track deployments, releases and health metrics.",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Project name",
                },
                slug: {
                  type: "string",
                  description: "Project slug (URL-friendly identifier)",
                },
                platform: {
                  type: "string",
                  description: "Platform (e.g., 'javascript', 'python', 'node')",
                },
                team: {
                  type: "string",
                  description: "Team slug",
                },
              },
              required: ["name", "slug", "team"],
            },
          },
          {
            name: "sentry_list_issue_events",
            description: "List events for a specific Sentry issue. Analyze event details, metadata and patterns.",
            inputSchema: {
              type: "object",
              properties: {
                issueId: {
                  type: "string",
                  description: "Issue ID",
                },
                limit: {
                  type: "number",
                  description: "Number of events to return",
                  default: 50,
                },
              },
              required: ["issueId"],
            },
          },
          {
            name: "sentry_get_issue",
            description: "Retrieve and analyze a Sentry issue. Accepts issue URL or ID.",
            inputSchema: {
              type: "object",
              properties: {
                issueId: {
                  type: "string",
                  description: "Issue ID or URL",
                },
              },
              required: ["issueId"],
            },
          },
          {
            name: "sentry_list_organization_replays",
            description: "List replays from a Sentry organization. Monitor user sessions, interactions, errors and experience issues.",
            inputSchema: {
              type: "object",
              properties: {
                project: {
                  type: "string",
                  description: "Project ID or slug",
                },
                limit: {
                  type: "number",
                  description: "Number of replays to return",
                  default: 50,
                },
                query: {
                  type: "string",
                  description: "Search query",
                },
              },
              required: [],
            },
          },
          {
            name: "sentry_setup_project",
            description: "Set up Sentry for a project returning a DSN and instructions for setup.",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
                platform: {
                  type: "string",
                  description: "Platform for installation instructions",
                  default: "javascript",
                },
              },
              required: ["projectSlug"],
            },
          },
          {
            name: "sentry_search_errors_in_file",
            description: "Search for Sentry errors occurring in a specific file. Find all issues related to a particular file path or filename.",
            inputSchema: {
              type: "object",
              properties: {
                projectSlug: {
                  type: "string",
                  description: "Project slug/identifier",
                },
                filename: {
                  type: "string",
                  description: "File path or filename to search for",
                },
              },
              required: ["projectSlug", "filename"],
            },
          },
        ],
      };
    });
  • Helper function mapSeverityLevel used to map string levels to Sentry SeverityLevel enums in the handler.
    function mapSeverityLevel(level: string): Sentry.SeverityLevel {
      const severityMap: Record<string, Sentry.SeverityLevel> = {
        fatal: "fatal",
        error: "error",
        warning: "warning",
        info: "info",
        debug: "debug",
      };
      return severityMap[level] || "error";
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Capture and send' implies a write operation to Sentry's monitoring system, but the description doesn't mention authentication requirements, rate limits, whether this creates a new event or logs to an existing one, or what happens after sending. For a tool that presumably sends data to an external service, this is insufficient 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 extremely concise at just 6 words, front-loading the core purpose with zero wasted language. Every word earns its place, making it easy for an agent to quickly understand the tool's basic function.

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?

Given no annotations, no output schema, and the tool's apparent function of sending data to an external monitoring system, the description is incomplete. It doesn't explain what happens after sending, whether there's confirmation or error handling, or how this integrates with Sentry's event lifecycle. For a tool that likely creates events in a monitoring platform, more context about the operation's impact would be helpful.

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 4 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 ('capture and send') and target ('message to Sentry'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'sentry_capture_exception' or 'sentry_capture_session', which would require explaining this is specifically for custom messages rather than exceptions or session data.

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. With multiple sibling tools like 'sentry_capture_exception' and 'sentry_capture_session', there's no indication whether this is for custom log messages, error reporting, or other use cases. No prerequisites or exclusions are mentioned.

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