Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_set_user

Set user context in Sentry to track errors and performance by user ID, email, IP address, and segment for better debugging and monitoring.

Instructions

Set user context for Sentry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoUser ID
emailNoUser email
usernameNoUsername
ip_addressNoUser IP address
segmentNoUser segment

Implementation Reference

  • Handler for the 'sentry_set_user' tool. Extracts user information from arguments and sets it as the current user context in Sentry using Sentry.setUser(). Returns a confirmation message.
    case "sentry_set_user": {
      const userInfo = args as any;
      Sentry.setUser(userInfo);
      
      return {
        content: [
          {
            type: "text",
            text: `User context set: ${JSON.stringify(userInfo)}`,
          },
        ],
      };
    }
  • src/index.ts:194-222 (registration)
    Tool registration in the ListTools response, defining the name, description, and input schema for 'sentry_set_user'.
    {
      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",
          },
        },
      },
    },
  • Input schema definition for the 'sentry_set_user' tool, specifying optional properties for user context.
      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",
          },
        },
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral information. It states this is a 'set' operation (implying mutation) but doesn't disclose what happens to existing user context, whether this persists across sessions, what permissions are required, or what the expected outcome is.

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 (4 words) and front-loaded with the essential action. There's no wasted language or unnecessary elaboration.

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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'user context' means in Sentry, how this affects error tracking, what happens after setting it, or what the tool returns. The context signals show 5 parameters but the description provides no guidance on their usage.

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 all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema, maintaining the baseline score for high schema coverage.

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 verb ('Set') and resource ('user context for Sentry'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'sentry_set_context', 'sentry_set_tag', or 'sentry_set_release', which all involve setting different types of Sentry 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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, timing considerations, or how it relates to other Sentry operations like session management or error tracking.

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