PagerDuty
Use this skill for read-only PagerDuty lookups: on-call, handoffs, schedules, escalation policies, services, teams, users, and incidents.
Call the API
- Call
https://api.pagerduty.comwithcurlfrom the sandbox. - Do not send an
Authorizationheader. Junior adds the PagerDuty credential to requests for this host. - Send
-H 'Accept: application/vnd.pagerduty+json;version=2'. - Use only
GET. The deployment key is read-only. - Pipe responses through
jqand keep only the fields you need. - Lists page with
limit(max100) andoffset. Followmore: trueonly when the answer needs more rows. - Array filters use bracket syntax, for example
schedule_ids[]=PABC123. Pass them withcurl -G --data-urlencode. - Times are ISO 8601. Pass
time_zone=<IANA zone>when the user names a zone.
Workflow
- Resolve the target.
- Use IDs or PagerDuty URLs from the request or the thread first. A URL such as
https://<subdomain>.pagerduty.com/schedules/PABC123contains the ID. - Otherwise resolve names with one search:
GET /schedules?query=<name>,GET /escalation_policies?query=<name>,GET /services?query=<name>,GET /teams?query=<name>, orGET /users?query=<name>. - If a search returns several plausible matches, list them and ask which one the user means.
- Pick the most direct endpoint.
| Question | Endpoint |
|---|---|
| Who is on call now for a schedule or policy | GET /oncalls?schedule_ids[]=<id> or escalation_policy_ids[]=<id>; add earliest=true |
| Who is rotating in or out, next handoff | GET /schedules/<id>?since=<now>&until=<now+7d>; read final_schedule.rendered_schedule_entries |
| What is a user's on-call coverage | GET /oncalls?user_ids[]=<id>&since=<start>&until=<end> |
| Who is on a schedule | GET /schedules/<id>/users |
| What is the escalation path | GET /escalation_policies/<id> |
| Which policy pages for a service | GET /services/<id>?include[]=escalation_policies |
| Team members | GET /teams/<id>/members?include[]=users |
| Open incidents | GET /incidents?statuses[]=triggered&statuses[]=acknowledged; filter with service_ids[] or team_ids[] |
| Incident detail, timeline, or notes | GET /incidents/<id>, GET /incidents/<id>/log_entries, GET /incidents/<id>/notes |
- Bound every query.
- Default "now" questions to the current time. Get it with
date -u +%Y-%m-%dT%H:%M:%SZ. - Default handoff questions to the next 7 days. Default incident history to the last 24 hours.
- In
/oncallsresults,escalation_level1is the primary responder. Say which level you report.
- Report the result.
- Lead with the answer: names, levels, and shift start and end times in the user's zone when known.
- For handoffs, name who is on call now, who is next, and the handoff time.
- Link to the object with its
html_urlwhen the response contains one. Do not build links from partial IDs. - Do not dump raw JSON.
Guardrails
- This skill is read-only. Decline requests to acknowledge, resolve, reassign, snooze, or create incidents, to add notes or responders, or to create overrides. Tell the user to do it in PagerDuty.
- Share only the contact details that the question needs. Do not list phone numbers or email addresses unless the user asks for them.
401 Unauthorized: report that the PagerDuty credential is missing or invalid for this Junior deployment. Do not retry.403 Forbidden: report that the PagerDuty credential cannot read the resource. Do not guess at missing permissions.429 Too Many Requests: wait briefly and retry the same request once. If it fails again, report the throttle.