Bugsnag Error Event Fetcher
This skill fetches raw error event data from Bugsnag and provides it directly for analysis. It's designed to work in cloud sandboxes without any dependencies.
When to Use This Skill
Use this skill when you need to:
- •Analyze production errors and crashes from Bugsnag
- •Investigate error patterns across multiple events
- •Debug issues reported by users
- •Review error context (stacktraces, breadcrumbs, device info, metadata)
How to Use
Simply provide a Bugsnag dashboard URL containing an event_id:
python scripts/bugsnag.py "https://app.bugsnag.com/org/project/errors/abc?event_id=123456"
The script will:
- •Extract the event_id from the URL
- •Fetch the full event data from Bugsnag API
- •Output the raw JSON event data
Authentication
The script looks for your Bugsnag auth token in this order:
- •Environment variable -
export BUGSNAG_AUTH_TOKEN=your-token-here - •~/.codex/config.toml - Configure in
[mcp_servers.smartbear].env.BUGSNAG_AUTH_TOKEN - •Embedded in script - Edit
scripts/bugsnag.pyand setEMBEDDED_TOKEN = "your-token-here"
Getting a Bugsnag Token
- •Log in to Bugsnag
- •Go to Settings → Data Access
- •Generate a new token with read permissions
- •Copy the token
Setting Up Authentication
Option 1: Environment variable (recommended)
export BUGSNAG_AUTH_TOKEN=your-token-here python scripts/bugsnag.py "URL"
Option 2: Config file (persistent)
# Add to ~/.codex/config.toml: [mcp_servers.smartbear.env] BUGSNAG_AUTH_TOKEN = "your-token-here"
Option 3: Embed in script (convenient for non-sensitive environments)
# Edit scripts/bugsnag.py, line ~38: EMBEDDED_TOKEN = "your-bugsnag-token-here"
What You Get
The script outputs raw JSON with complete event data:
- •Error class and message
- •Full stacktrace with code frames
- •ALL breadcrumbs (no truncation)
- •Device and app information
- •Complete metadata (Timer, auth, counter, etc.)
- •User information
- •Feature flags and correlation
This is the same data you see in Bugsnag dashboard, but in structured JSON format perfect for analysis.
Examples
Basic Usage
python scripts/bugsnag.py "https://app.bugsnag.com/myorg/myapp/errors/abc?event_id=123"
With Custom Project ID
By default, the script uses project ID 5e7e6984e2a5fe0014dbf1a8. To override:
# Edit scripts/bugsnag.py, line ~41: DEFAULT_PROJECT_ID = "your-project-id-here"
Analyzing Multiple Events
for url in event1_url event2_url event3_url; do echo "=== Fetching $url ===" python scripts/bugsnag.py "$url" done
Understanding the Output
Key fields in the JSON output:
- •
exceptions[0].error_class- Type of error (e.g., "NullPointerException") - •
exceptions[0].message- Error message - •
exceptions[0].stacktrace- Array of stack frames - •
breadcrumbs- User actions leading to error - •
metaData- Custom metadata (Timer, counter, etc.) - •
device- Device information - •
app- App version and state - •
user- User identification
Alternative: cURL Version
If Python isn't available, use this bash/curl one-liner:
# Set your token
TOKEN="your-token-here"
EVENT_ID="697448c0016289a055ed0000"
PROJECT_ID="5e7e6984e2a5fe0014dbf1a8"
curl -H "Authorization: token $TOKEN" \
-H "Accept: application/json" \
"https://api.bugsnag.com/projects/$PROJECT_ID/events/$EVENT_ID"
Troubleshooting
"Could not find event_id in URL"
- •Make sure the URL contains
?event_id=...or&event_id=... - •Example:
https://app.bugsnag.com/.../errors/abc?event_id=123
"Authentication failed" or "401 Unauthorized"
- •Check your token is valid
- •Verify token has read permissions for events
- •Make sure token is set in one of the three locations
"Project not found" or "Event not found"
- •Verify the project ID is correct
- •Check the event_id is valid
- •Ensure your token has access to this project
Security Notes
- •Embedded tokens: Only use in trusted/non-shared environments
- •~/keys file: Make sure it's not world-readable (
chmod 600 ~/keys) - •Environment variables: Preferred for CI/CD and shared environments
- •Never commit tokens to version control