Skip to content

Commit 88de69b

Browse files
cameroncookeClaude Code Opuscursoragent
authored
docs(snapshots): Add agentic workflow page (#17939)
## DESCRIBE YOUR PR Adds a new Snapshots documentation page, **Agentic Workflow**, covering how to use Sentry's MCP server to investigate snapshot results with an AI coding assistant (Claude Code, Cursor, VS Code, and others) instead of clicking through the Sentry UI or downloading images by hand. - Explains connecting to the Sentry MCP server (endpoints and OAuth) - Documents the optional **Preprod Snapshots** capability: what the agent can do by default via `get_sentry_resource` versus the advanced tools it unlocks (`get_snapshot`, `get_snapshot_image`, `get_latest_base_snapshot`), plus the context-window tradeoff - Walks through four agent use-cases: investigate a failed CI snapshot check, inspect a changed image, triage before approving, and look up an app's latest baseline - Points to `sentry-cli` and Local Testing for local download and diff workflows The page sits in the Snapshots section (`sidebar_order: 30`) and is gated behind the Early Adopter include. Tool names, parameters, and the example responses were verified against the live Sentry MCP server. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Code Opus <noreply@example.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 94bb4ac commit 88de69b

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

  • docs/product/snapshots/agentic-workflow
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
<Alert level="info">
16+
The Sentry MCP has been optimized to retrieve Snapshot results for agentic
17+
workflows. If you'd like, you can also fetch the data via the [REST
18+
API](/api/snapshots/) and expose scripts to agents.
19+
</Alert>
20+
21+
Connect using one of these endpoints:
22+
23+
- `https://mcp.sentry.dev/mcp`: base endpoint
24+
- `https://mcp.sentry.dev/mcp/{organizationSlug}`: scoped to one organization
25+
- `https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}`: scoped to one project (recommended)
26+
27+
The first connection starts an OAuth flow to link your Sentry account.
28+
29+
### Advanced Snapshot Tools (Optional)
30+
31+
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.
32+
33+
<Alert level="info">
34+
To go further, grant the agent the advanced snapshot tools by enabling the
35+
**Preprod Snapshots** capability on the MCP authorization screen (it's off by
36+
default; check it when you first connect, or re-authorize to add it later).
37+
These tools let the agent fetch full-resolution images, list unchanged images,
38+
and look up an app's latest baseline. They give the agent more options but
39+
take up more of its context window while enabled.
40+
</Alert>
41+
42+
## Agent Workflow Examples
43+
44+
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.
45+
46+
### Investigate a Failed CI Snapshot Check
47+
48+
Paste the snapshot URL from the failing GitHub status check:
49+
50+
> **You:** This snapshot check failed: `https://my-org.sentry.io/preprod/snapshots/231949/`. What changed?
51+
52+
> **Agent:** 12 of 340 snapshots changed on PR #4821 (`feat/new-nav` vs `main`), all in the navigation sidebar. The biggest diffs are:
53+
>
54+
> - `sidebar-expanded-dark.png`: 18% changed
55+
> - `sidebar-collapsed-dark.png`: 14% changed
56+
> - `sidebar-expanded-light.png`: 11% changed
57+
>
58+
> Want me to inspect the largest change and tell you what's different?
59+
60+
### Inspect a Changed Image
61+
62+
> **You:** Yes, please.
63+
64+
> **Agent:** _[fetches and compares the current, base, and diff-mask images for `sidebar-expanded-dark.png`]_
65+
>
66+
> 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?
67+
68+
### Triage Before Approving
69+
70+
> **You:** Are these changes all from my nav refactor, or did anything else regress?
71+
72+
> **Agent:** All 12 changed snapshots are navigation sidebar screens, which matches your `feat/new-nav` PR. Nothing changed outside that component.
73+
74+
### Look Up the Current Baseline for an App
75+
76+
> **You:** Which settings screens do we have baselines for in `web-frontend`?
77+
78+
> **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`).
79+
80+
## CLI and Local Workflows
81+
82+
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)