---
sidebar_position: 2
title: Sentry
---

# Sentry skill

Read-only access to a connected Sentry organization — list projects, list issues, fetch issue details.

- **ID:** `sentry`
- **MCP server:** `sentry` (tools exposed as `mcp__sentry__*`)

## Tools provided

| Tool | What it does |
|---|---|
| `sentry_list_projects` | List projects in the connected organization (slug, name, platform) |
| `sentry_list_issues` | List issues. Supports `project`, `query` (Sentry search syntax, default `is:unresolved`), `sort` (`date`/`new`/`priority`/`freq`/`user`), `limit` |
| `sentry_get_issue` | Detailed info for one issue by `issueId` — title, culprit, counts, first/last seen, level, status |

## Setup

Sentry uses OAuth 2.0 with PKCE (public client — no client secret).

1. In the Zibby dashboard, go to **Settings → Integrations**.
2. Click **Connect Sentry**.
3. Approve the organization in the Sentry consent screen.
4. You're redirected back; the access token + organization slug are stored encrypted on the project.

The backend (`/integrations/sentry/connect` and `/integrations/sentry/callback`) handles the PKCE exchange. Tokens auto-refresh on use; if refresh fails, click **Reconnect** in the same settings panel.

## Use in an agent

```js
import { WorkflowAgent, WorkflowGraph } from '@zibby/core';
import { SKILLS } from '@zibby/skills';

export class SentryTriage extends WorkflowAgent {
  buildGraph() {
    const graph = new WorkflowGraph();
    graph.addNode('triage', {
      agent: 'claude',
      skills: [SKILLS.SENTRY],
      prompt: () => `Use sentry_list_issues with query "is:unresolved level:error" to find the
      top 10 unresolved errors. Then call sentry_get_issue for the highest-frequency one
      and summarize what's failing.`,
    });
    return graph;
  }
}
```

## Output example

`sentry_list_issues`:

```json
{
  "issues": [
    {
      "id": "5712345678",
      "title": "TypeError: Cannot read properties of undefined (reading 'id')",
      "culprit": "src/handlers/checkout.ts in handleSubmit",
      "count": 1247,
      "firstSeen": "2026-05-01T14:22:10Z",
      "lastSeen": "2026-05-16T09:11:03Z",
      "level": "error",
      "status": "unresolved"
    }
  ]
}
```

## Implementation notes

Spawns `packages/skills/bin/mcp-sentry.mjs` via `node`. Auth is delegated: the bin calls the Zibby backend's `resolveIntegrationToken('sentry')` endpoint using `PROJECT_API_TOKEN` + `PROGRESS_API_URL` (passed through from the Fargate environment).

`alwaysLoad: true` is set on the MCP server config so Sentry tools land in the initial system prompt instead of behind the Claude SDK's lazy `ToolSearch` (which misses MCP-served tools by keyword).

The skill also implements `handleToolCall` for the `assistant` agent strategy (OpenAI Assistant API), which doesn't speak MCP — same Sentry API, dispatched in-process.
