Press a step to see its codeLook up the requestor and ticket, lines 24 to 29Find the escalation contact, lines 31 to 38Page the on-call responder, lines 40 to 60Record the escalation on the ticket, lines 62 to 66
Look up the requestor and ticket
ticket === null
Fail
No ticket is attached to this run — run this tool from a ticket.
Find the escalation contact
get_manager resolves null when the IdP profile has no manager set
Page the on-call responder
response.status_code !== 202
Fail
PagerDuty rejected the event (${response.status_code}) — check the routing key.
Record the escalation on the ticket
Return
return
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
true
false
true
false
1// Page the on-call responder about the ticket this run is attached to,
2// including the requestor's manager as the escalation contact, then record
3// what happened as an internal ticket comment.
4//
5// Before publishing: set the PAGERDUTY_ROUTING_KEY config value to an
6// Events API v2 integration key.
7
8exportconst input = z.object({
9summary: z
10.string()
11.min(1)
12.describe("One line describing the incident being escalated"),
13severity: z
14.enum(["critical","error","warning","info"])
15.default("error")
16.describe("PagerDuty event severity"),
17});
18
19// http.post needs a "read_write" posture; publishing a script with one