---
title: "ai agent for sentry: read the error, find the cause, ship the fix"
description: "connect sentry to a room and its agents search issues and events, read stack traces, replays and profiles, resolve or assign, and fix the code the trace names."
url: "https://aldena.ai/integrations/sentry"
---

# ai agent for sentry: read the error, find the cause, ship the fix

an alert tells you something broke. it rarely tells you what to change. connecting sentry to a room closes that gap, because the agent that reads the stack trace also has the repository on a machine it can run.

## reading the whole picture

`sentry_search_issues` takes sentry query syntax and `sentry_get_resource` reads one issue by short id with its status, assignee and culprit. `sentry_search_events` queries the errors, logs, or spans dataset with optional aggregation, and `sentry_search_issue_events` lists the individual events under one issue. `sentry_get_issue_tag_values` answers which release or which browser, `sentry_get_event_attachment` pulls an attachment into the chat, and `sentry_get_replay_details` and `sentry_get_profile_details` bring in the session replay and the profile behind a slow transaction.

## knowing where it is looking

`sentry_whoami`, `sentry_find_organizations`, `sentry_find_teams`, `sentry_find_projects`, `sentry_find_releases` and `sentry_find_dsns` describe the connected organization. a room connects to exactly one organization, so an agent cannot wander into a neighbouring account's error stream by accident.

## acting on it

`sentry_update_issue` resolves, ignores, unresolves or assigns, and it asks before it runs. the heavier changes, creating teams and projects, editing project settings, and minting client keys, sit behind a scope that is off by default, because a new dsn is a credential.

## example tasks

- **the checkout error spiked after this morning's release. find out why.**

  the agent reads the issue and its recent events, checks which release the tag values point at, then reads the matching commit in the repository on the room server.

  tools: `sentry_search_issues` -> `sentry_search_issue_events` -> `sentry_get_issue_tag_values` -> `github_get_commit`

- **fix the top unresolved error and resolve it once the pr is merged.**

  it reads the trace, reproduces the failure on the room server, opens the pull request, and marks the issue resolved only after you approve both steps.

  tools: `sentry_get_resource` -> `bash` -> `github_create_pull_request` -> `sentry_update_issue`

- **watch the api project and wake up on anything new.**

  the project subscription wakes the agent in this chat on new issues and errors, and it reads the events before deciding whether it is worth interrupting you.

  tools: `sentry_subscribe` -> `sentry_get_resource` -> `sentry_search_issue_events`

## what it will not do

an agent cannot delete a project or an issue, change organization billing, or manage members. it reaches exactly one sentry organization, the one the room connected, and the project and dsn tools stay absent unless you deliberately turn their scope on.

## faq

### can an ai agent triage sentry issues?

yes. sentry_search_issues runs sentry query syntax, sentry_get_resource reads one issue by short id with its status, assignee and culprit, and sentry_update_issue resolves, ignores, unresolves or assigns it. the update is a mutating tool, so it asks before it runs.

### can the agent see the actual error, not just the title?

yes. sentry_search_issue_events lists the individual events behind an issue, sentry_get_issue_tag_values shows which releases or browsers it hit, sentry_get_event_attachment pulls an attachment into the chat, and sentry_get_replay_details and sentry_get_profile_details read the session replay and profile metadata.

### does it stop at reading, or can it fix the bug?

the room owns a server, so the same agent that read the stack trace clones the repository onto it, reproduces the failure over bash, writes the change, runs the tests, and opens the pull request. that is the step a monitoring assistant cannot take.

### can an agent create projects or mint dsns?

sentry_create_project, sentry_create_team, sentry_update_project and sentry_create_dsn sit behind the create teams, projects and dsns scope, which is off by default. leave it off and those tools do not exist in the room. turn it on and each call still asks first.

### how does an agent react to a new error as it happens?

sentry_subscribe attaches it to a project or a single issue. new, resolved, assigned, ignored and unresolved issues, new errors and issue comments then wake the agent in the chat where it subscribed, so a regression can be investigated while it is still happening.
