// "Fetch and analyze Sentry issues and search logs directly from the API. Helps agents understand errors, stack traces, logs, and issue context."
| name | sentry |
| description | Fetch and analyze Sentry issues and search logs directly from the API. Helps agents understand errors, stack traces, logs, and issue context. |
Access Sentry data directly via the API. Uses auth token from ~/.sentryclirc.
./tools/fetch-issue.js <issue-id-or-url>
Accepts either:
5765604106https://sentry.io/organizations/sentry/issues/5765604106/https://myorg.sentry.io/issues/5765604106/JAVASCRIPT-ABC (requires --org flag)Examples:
./tools/fetch-issue.js 5765604106
./tools/fetch-issue.js https://sentry.io/organizations/sentry/issues/5765604106/
./tools/fetch-issue.js https://myorg.sentry.io/issues/5765604106/
./tools/fetch-issue.js JAVASCRIPT-ABC --org sentry
./tools/fetch-issue.js <issue-id-or-url> --latest
Fetches the latest event for the issue, including full stack trace.
Returns formatted issue details including:
With --latest, also shows:
./tools/search-logs.js [query|url] [options]
Search for logs in Sentry's Logs Explorer.
Accepts either:
--org flag--org, -o <org> - Organization slug (required unless URL provided)--project, -p <project> - Filter by project slug or ID--period, -t <period> - Time period (default: 24h, e.g., 1h, 7d, 90d)--limit, -n <n> - Max results (default: 100, max: 1000)--json - Output raw JSONlevel:error Filter by log level (trace, debug, info, warn, error, fatal)
message:*timeout* Search message text with wildcards
trace:abc123 Filter by trace ID
project:my-project Filter by project slug
Combine filters: level:error message:*failed*
# List recent logs for an org
./tools/search-logs.js --org myorg
# Search for errors in a specific project
./tools/search-logs.js "level:error" --org myorg --project backend
# Search for timeout messages in the last 7 days
./tools/search-logs.js "message:*timeout*" --org myorg --period 7d
# Get logs as JSON
./tools/search-logs.js --org myorg --limit 50 --json
# Use a Sentry logs explorer URL directly
./tools/search-logs.js "https://myorg.sentry.io/explore/logs/?project=123&statsPeriod=7d"
Returns log entries with: