Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_capture_session

Capture session data for application monitoring by recording session identifiers, user activity, duration, and error counts to track performance and health.

Instructions

Manually capture a session for server-mode/request-mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesUnique session identifier
distinctIdNoUser identifier
statusNoSession statusok
durationNoSession duration in seconds
errorsNoNumber of errors in session

Implementation Reference

  • The handler function for the 'sentry_capture_session' tool. It extracts parameters, constructs session data, adds a breadcrumb to Sentry for monitoring, and returns a confirmation message.
    case "sentry_capture_session": {
      const { sessionId, distinctId, status = "ok", duration, errors = 0 } = args as any;
      
      // Capture session data manually (useful for server-mode)
      const sessionData = {
        sid: sessionId,
        did: distinctId,
        status,
        duration,
        errors,
        timestamp: Date.now() / 1000,
        attrs: {
          release: config.release,
          environment: config.environment || "production",
        },
      };
      
      // Log session for monitoring
      Sentry.addBreadcrumb({
        category: "session",
        message: `Session ${sessionId} captured`,
        level: "info",
        data: sessionData,
      });
      
      return {
        content: [
          {
            type: "text",
            text: `Session captured: ${sessionId} (status: ${status}, duration: ${duration}s, errors: ${errors})`,
          },
        ],
      };
    }
  • The input schema definition for the 'sentry_capture_session' tool, defining parameters like sessionId, distinctId, status, duration, and errors.
    {
      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"],
      },
    },
  • src/index.ts:355-387 (registration)
    Registration of the 'sentry_capture_session' tool in the ListTools response, including name, description, and schema.
    {
      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"],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'manually capture a session', implying a write operation that creates or updates session data, but doesn't specify permissions, side effects, error handling, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for the tool's complexity, though it could be more informative. Every word earns its place, but the brevity limits helpfulness.

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 the tool's complexity (a mutation with 5 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain what 'capturing a session' entails, the implications of different statuses, or what happens after invocation. For a tool that likely modifies system state, more context is needed to guide effective use.

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%, with all parameters well-documented in the input schema (e.g., 'sessionId' as 'Unique session identifier'). The description adds no additional parameter details beyond what the schema provides. According to the rules, with high schema coverage (>80%), the baseline score is 3, as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

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

The description states the action ('capture a session') and specifies the context ('for server-mode/request-mode'), which clarifies the purpose. However, it doesn't explicitly distinguish this tool from sibling tools like 'sentry_start_session' or 'sentry_end_session', leaving ambiguity about when to use each. The purpose is clear but lacks sibling differentiation.

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 like 'sentry_start_session' or 'sentry_end_session'. It mentions 'server-mode/request-mode' but doesn't explain what that means or when it applies. There are no explicit instructions on prerequisites, timing, or exclusions, making usage unclear.

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