Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_setup_project

Configure Sentry error monitoring for a project by generating a DSN and providing platform-specific setup instructions.

Instructions

Set up Sentry for a project returning a DSN and instructions for setup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectSlugYesProject slug/identifier
platformNoPlatform for installation instructionsjavascript

Implementation Reference

  • Handler function for the 'sentry_setup_project' tool. Retrieves or creates a Sentry project key to obtain the DSN and generates platform-specific installation instructions.
          case "sentry_setup_project": {
            if (!apiClient) {
              throw new Error("Sentry API client not initialized. Provide auth token.");
            }
            
            const { projectSlug, platform = "javascript" } = args as any;
            
            // Get project keys (DSN)
            const keys = await apiClient.listProjectKeys(projectSlug);
            let dsn = '';
            
            if (keys.length > 0) {
              dsn = keys[0].dsn.public;
            } else {
              // Create a new key if none exists
              const newKey = await apiClient.createProjectKey(projectSlug, 'Default');
              dsn = newKey.dsn.public;
            }
            
            // Installation instructions based on platform
            const instructions: { [key: string]: string } = {
              javascript: `// Install Sentry
    npm install --save @sentry/browser
    
    // Initialize Sentry
    import * as Sentry from "@sentry/browser";
    
    Sentry.init({
      dsn: "${dsn}",
      integrations: [
        Sentry.browserTracingIntegration(),
        Sentry.replayIntegration(),
      ],
      tracesSampleRate: 1.0,
      replaysSessionSampleRate: 0.1,
      replaysOnErrorSampleRate: 1.0,
    });`,
              node: `// Install Sentry
    npm install --save @sentry/node
    
    // Initialize Sentry
    const Sentry = require("@sentry/node");
    
    Sentry.init({
      dsn: "${dsn}",
      tracesSampleRate: 1.0,
    });`,
              python: `# Install Sentry
    pip install --upgrade sentry-sdk
    
    # Initialize Sentry
    import sentry_sdk
    
    sentry_sdk.init(
        dsn="${dsn}",
        traces_sample_rate=1.0,
        profiles_sample_rate=1.0,
    )`,
            };
            
            return {
              content: [
                {
                  type: "text",
                  text: `Sentry setup for project ${projectSlug}:\n\n` +
                    `DSN: ${dsn}\n\n` +
                    `Installation instructions for ${platform}:\n\n` +
                    (instructions[platform] || instructions.javascript),
                },
              ],
            };
          }
  • src/index.ts:652-670 (registration)
    Registration of the 'sentry_setup_project' tool including name, description, and input schema definition.
    {
      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"],
      },
    },
  • Input schema definition for the 'sentry_setup_project' tool.
    inputSchema: {
      type: "object",
      properties: {
        projectSlug: {
          type: "string",
          description: "Project slug/identifier",
        },
        platform: {
          type: "string",
          description: "Platform for installation instructions",
          default: "javascript",
        },
      },
      required: ["projectSlug"],
    },
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 lacks behavioral details. It implies a write operation ('Set up') but doesn't disclose permissions required, side effects (e.g., if it modifies existing settings), rate limits, or error handling. The mention of returning a DSN and instructions is useful but insufficient for a mutation tool.

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 front-loads the core purpose and outcome. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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 incomplete. It doesn't explain the return format (e.g., structure of DSN/instructions), error conditions, or dependencies. Given the complexity of setup operations, more context is needed for 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%, so the schema fully documents both parameters. The description adds no additional meaning beyond implying 'platform' influences the instructions returned, but this is already suggested by the schema's description. Baseline 3 is appropriate as the schema handles parameter documentation.

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 ('Set up Sentry') and the resource ('for a project'), specifying the outcome ('returning a DSN and instructions for setup'). It distinguishes from siblings like 'sentry_create_project' by focusing on setup/configuration rather than creation, though it doesn't explicitly contrast with them.

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. It doesn't mention prerequisites (e.g., if the project must already exist), nor does it differentiate from similar tools like 'sentry_create_project' or 'sentry_set_context' in usage context.

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