Search eventsSENTRY_MCP_SEARCH_EVENTS
Search Sentry events and replays. Use for event counts/statistics.
`query` can be natural language or Sentry search syntax. With an agent configured, it fixes dataset, query, fields, and sort before running.
Supports TWO query types:
1. AGGREGATIONS (counts, sums, averages): 'how many errors', 'total tokens'
2. Individual events with timestamps: 'error logs from last hour'
Datasets:
- errors: Exception/crash events with stack traces, usually grouped into issues
- logs: Application log entries, including error-severity log messages
- spans: Raw trace/span events for performance, AI/LLM calls, requests, and operations
- metrics: Metric rows and aggregates: counters, gauges, distributions, values
- profiles: Transaction/continuous profile results, profile IDs, profiled transactions
- replays: Session replay results: rage clicks, dead clicks, visited pages, replay users
If the user says logs, log messages, error logs, or warning logs, choose logs instead of errors.
Replay searches return replay lists only; replay count()/avg()/sum() are not supported.
NOT for grouped issue lists (use search_issues) or app screenshots/images (use get_latest_base_snapshot).
<examples>
search_events(organizationSlug='my-org', query='how many errors today')
search_events(organizationSlug='my-org', dataset='errors', query='level:error')
search_events(organizationSlug='my-org', dataset='errors', fields=['issue', 'count()'], sort='-count()')
search_events(organizationSlug='my-org', dataset='spans', query='span.op:db', sort='-span.duration')
search_events(organizationSlug='my-org', dataset='replays', query='count_errors:>0', sort='-count_errors')
</examples>
<hints>
- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.
- Parse org/project notation directly without calling find_organizations or find_projects.
- Use fields with aggregate functions like count(), avg(), sum() for statistics
- Sort by -count() for most common, -timestamp for newest
</hints>