Skip to content

Commit 2c71066

Browse files
cameroncookeClaude Code Opus
andcommitted
docs(snapshots): Add agentic workflow page
Add a Snapshots child page that explains how to use Sentry MCP for agent-assisted snapshot investigation. Cover setup, Preprod Snapshots tool selection, snapshot URL handling, primitive snapshot tools, and when to use CLI workflows instead. Co-Authored-By: Claude Code Opus <noreply@example.com>
1 parent 5d47d29 commit 2c71066

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

  • docs/product/snapshots/agentic-workflow
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Agentic Workflow
3+
sidebar_order: 30
4+
description: Connect an AI agent to Sentry's MCP server to inspect snapshot diffs, images, and baselines.
5+
---
6+
7+
<Include name="feature-available-for-user-group-early-adopter" />
8+
9+
Connect an AI coding assistant to Sentry's MCP server so it can pull snapshot diffs, images, and baselines on your behalf. This lets you investigate snapshot failures by asking the agent, instead of clicking through the Sentry UI or downloading images by hand. It complements the [local CLI workflow](/product/snapshots/local-testing/): MCP is built for agent-assisted investigation and review, while `sentry-cli` is built for local downloads and diffing.
10+
11+
## Set Up Sentry MCP
12+
13+
Sentry's [MCP server](https://mcp.sentry.dev) connects your AI assistant to Sentry over the Model Context Protocol. Follow the setup and authentication instructions there for your client (Claude Code, Cursor, VS Code, and others).
14+
15+
Connect using one of these endpoints:
16+
17+
- `https://mcp.sentry.dev/mcp`: base endpoint
18+
- `https://mcp.sentry.dev/mcp/{organizationSlug}`: scoped to one organization
19+
- `https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}`: scoped to one project (recommended)
20+
21+
The first connection starts an OAuth flow to link your Sentry account.
22+
23+
### Advanced Snapshot Tools (Optional)
24+
25+
For most investigations the agent needs no extra setup. By default, it can read any snapshot URL and return the diff summary plus a changed image's current, base, and diff-mask previews.
26+
27+
<Alert level="info">
28+
To go further, grant the agent the advanced snapshot tools by enabling the
29+
**Preprod Snapshots** capability on the MCP authorization screen (it's off by
30+
default; check it when you first connect, or re-authorize to add it later).
31+
These tools let the agent fetch full-resolution images, list unchanged images,
32+
and look up an app's latest baseline. They give the agent more options but
33+
take up more of its context window while enabled.
34+
</Alert>
35+
36+
## Agent Workflow Examples
37+
38+
You describe what you want in natural language; the agent picks the right tool, inspects the results, and reports back. The exchanges below are representative; your agent's exact wording will vary.
39+
40+
### Investigate a Failed CI Snapshot Check
41+
42+
Paste the snapshot URL from the failing GitHub status check:
43+
44+
> **You:** This snapshot check failed: `https://my-org.sentry.io/preprod/snapshots/231949/`. What changed?
45+
46+
> **Agent:** 12 of 340 snapshots changed on PR #4821 (`feat/new-nav` vs `main`), all in the navigation sidebar. The biggest diffs are:
47+
>
48+
> - `sidebar-expanded-dark.png`: 18% changed
49+
> - `sidebar-collapsed-dark.png`: 14% changed
50+
> - `sidebar-expanded-light.png`: 11% changed
51+
>
52+
> Want me to inspect the largest change and tell you what's different?
53+
54+
### Inspect a Changed Image
55+
56+
> **You:** Yes, please.
57+
58+
> **Agent:** _[fetches and compares the current, base, and diff-mask images for `sidebar-expanded-dark.png`]_
59+
>
60+
> This one is `changed` at 18% (group `Sidebar/dark`, from `navigationSidebar.snapshots.tsx`). The sidebar is wider and each nav item has more horizontal padding, which pushes the labels to the right. That matches the spacing work in your `feat/new-nav` PR. If the extra width wasn't intended, the likely cause is the new container `width` on the sidebar wrapper. Want me to open that component and take a look?
61+
62+
### Triage Before Approving
63+
64+
> **You:** Are these changes all from my nav refactor, or did anything else regress?
65+
66+
> **Agent:** All 12 changed snapshots are navigation sidebar screens, which matches your `feat/new-nav` PR. Nothing changed outside that component.
67+
68+
### Look Up the Current Baseline for an App
69+
70+
> **You:** Which settings screens do we have baselines for in `web-frontend`?
71+
72+
> **Agent:** The latest baseline on `main` includes three settings screens: `settings-profile-light.png`, `settings-profile-dark.png`, and `settings-billing-light.png` (group `Settings`).
73+
74+
## CLI and Local Workflows
75+
76+
For downloading images in bulk and local diffing, use `sentry-cli`. See [Local Testing](/product/snapshots/local-testing/) and the [Snapshots CLI reference](/cli/snapshots/).

0 commit comments

Comments
 (0)