pagerduty-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePagerDuty Automation via Rube MCP
通过Rube MCP实现PagerDuty自动化
Automate PagerDuty incident management and operations through Composio's PagerDuty toolkit via Rube MCP.
通过Composio的PagerDuty工具包,借助Rube MCP实现PagerDuty事件管理与运维自动化。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active PagerDuty connection via with toolkit
RUBE_MANAGE_CONNECTIONSpagerduty - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
- 已通过激活PagerDuty连接,工具包为
RUBE_MANAGE_CONNECTIONSpagerduty - 请务必先调用以获取最新的工具模式
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSpagerduty - If connection is not ACTIVE, follow the returned auth link to complete PagerDuty authentication
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥——只需添加端点即可使用。
https://rube.app/mcp- 确认可响应,以此验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用并指定工具包
RUBE_MANAGE_CONNECTIONSpagerduty - 若连接状态未显示为ACTIVE,请按照返回的认证链接完成PagerDuty认证
- 在运行任何工作流之前,确认连接状态为ACTIVE
Core Workflows
核心工作流
1. Manage Incidents
1. 事件管理
When to use: User wants to create, update, acknowledge, or resolve incidents
Tool sequence:
- - List incidents with filters [Required]
PAGERDUTY_FETCH_INCIDENT_LIST - - Get specific incident details [Optional]
PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID - - Create a new incident [Optional]
PAGERDUTY_CREATE_INCIDENT_RECORD - - Update incident status or assignment [Optional]
PAGERDUTY_UPDATE_INCIDENT_BY_ID - - Add a note to an incident [Optional]
PAGERDUTY_POST_INCIDENT_NOTE_USING_ID - - Snooze an incident for a period [Optional]
PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION
Key parameters:
- : Filter by status ('triggered', 'acknowledged', 'resolved')
statuses[] - : Filter by service IDs
service_ids[] - : Filter by urgency ('high', 'low')
urgencies[] - : Incident title (for creation)
title - : Service object with
serviceandid(for creation)type - : New status for update operations
status
Pitfalls:
- Incident creation requires a object with both
serviceandidtype: 'service_reference' - Status transitions follow: triggered -> acknowledged -> resolved
- Cannot transition from resolved back to triggered directly
- requires the incident ID as a path parameter
PAGERDUTY_UPDATE_INCIDENT_BY_ID - Snooze duration is in seconds; the incident re-triggers after the snooze period
适用场景:用户需要创建、更新、确认或解决事件
工具序列:
- - 按筛选条件列出事件 [必填]
PAGERDUTY_FETCH_INCIDENT_LIST - - 获取特定事件详情 [可选]
PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID - - 创建新事件 [可选]
PAGERDUTY_CREATE_INCIDENT_RECORD - - 更新事件状态或分配对象 [可选]
PAGERDUTY_UPDATE_INCIDENT_BY_ID - - 为事件添加备注 [可选]
PAGERDUTY_POST_INCIDENT_NOTE_USING_ID - - 将事件暂停指定时长 [可选]
PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION
关键参数:
- : 按状态筛选('triggered', 'acknowledged', 'resolved')
statuses[] - : 按服务ID筛选
service_ids[] - : 按紧急程度筛选('high', 'low')
urgencies[] - : 事件标题(用于创建事件)
title - : 包含
service和id的服务对象(用于创建事件)type - : 更新操作的新状态
status
注意事项:
- 创建事件时,对象必须同时包含
service和idtype: 'service_reference' - 状态转换流程:triggered -> acknowledged -> resolved
- 无法从resolved状态直接转换回triggered状态
- 需要将事件ID作为路径参数
PAGERDUTY_UPDATE_INCIDENT_BY_ID - 暂停时长以秒为单位;暂停结束后事件将重新触发
2. Inspect Incident Alerts and Analytics
2. 查看事件告警与分析数据
When to use: User wants to review alerts within an incident or analyze incident metrics
Tool sequence:
- - List alerts for an incident [Required]
PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID - - Get details of a specific alert [Optional]
PAGERDUTY_GET_INCIDENT_ALERT_DETAILS - - Get incident analytics/metrics [Optional]
PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID
Key parameters:
- : The incident ID
incident_id - : Specific alert ID within the incident
alert_id - : Filter alerts by status
statuses[]
Pitfalls:
- An incident can have multiple alerts; each alert has its own status
- Alert IDs are scoped to the incident
- Analytics data includes response times, engagement metrics, and resolution times
适用场景:用户需要查看事件内的告警或分析事件指标
工具序列:
- - 列出事件的所有告警 [必填]
PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID - - 获取特定告警的详情 [可选]
PAGERDUTY_GET_INCIDENT_ALERT_DETAILS - - 获取事件分析/指标数据 [可选]
PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID
关键参数:
- : 事件ID
incident_id - : 事件内的特定告警ID
alert_id - : 按状态筛选告警
statuses[]
注意事项:
- 一个事件可包含多个告警;每个告警有自己的状态
- 告警ID的作用域为所属事件
- 分析数据包含响应时间、参与指标和解决时间
3. Manage Services
3. 服务管理
When to use: User wants to create, update, or list services
Tool sequence:
- - List all services [Required]
PAGERDUTY_RETRIEVE_LIST_OF_SERVICES - - Get service details [Optional]
PAGERDUTY_RETRIEVE_SERVICE_BY_ID - - Create a new technical service [Optional]
PAGERDUTY_CREATE_NEW_SERVICE - - Update service configuration [Optional]
PAGERDUTY_UPDATE_SERVICE_BY_ID - - Add an integration to a service [Optional]
PAGERDUTY_CREATE_INTEGRATION_FOR_SERVICE - - Create a business service [Optional]
PAGERDUTY_CREATE_BUSINESS_SERVICE - - Update a business service [Optional]
PAGERDUTY_UPDATE_BUSINESS_SERVICE_BY_ID
Key parameters:
- : Service name
name - : Escalation policy object with
escalation_policyandidtype - : Alert creation mode ('create_alerts_and_incidents' or 'create_incidents')
alert_creation - : Service status ('active', 'warning', 'critical', 'maintenance', 'disabled')
status
Pitfalls:
- Creating a service requires an existing escalation policy
- Business services are different from technical services; they represent business-level groupings
- Service integrations define how alerts are created (email, API, events)
- Disabling a service stops all incident creation for that service
适用场景:用户需要创建、更新或列出服务
工具序列:
- - 列出所有服务 [必填]
PAGERDUTY_RETRIEVE_LIST_OF_SERVICES - - 获取服务详情 [可选]
PAGERDUTY_RETRIEVE_SERVICE_BY_ID - - 创建新的技术服务 [可选]
PAGERDUTY_CREATE_NEW_SERVICE - - 更新服务配置 [可选]
PAGERDUTY_UPDATE_SERVICE_BY_ID - - 为服务添加集成 [可选]
PAGERDUTY_CREATE_INTEGRATION_FOR_SERVICE - - 创建业务服务 [可选]
PAGERDUTY_CREATE_BUSINESS_SERVICE - - 更新业务服务 [可选]
PAGERDUTY_UPDATE_BUSINESS_SERVICE_BY_ID
关键参数:
- : 服务名称
name - : 包含
escalation_policy和id的升级策略对象type - : 告警创建模式('create_alerts_and_incidents' 或 'create_incidents')
alert_creation - : 服务状态('active', 'warning', 'critical', 'maintenance', 'disabled')
status
注意事项:
- 创建服务需要已存在的升级策略
- 业务服务与技术服务不同;它们代表业务层面的分组
- 服务集成定义了告警的创建方式(邮件、API、事件)
- 禁用服务将停止该服务的所有事件创建
4. Manage Schedules and On-Call
4. 排班与随叫随到管理
When to use: User wants to view or manage on-call schedules and rotations
Tool sequence:
- - List all schedules [Required]
PAGERDUTY_GET_SCHEDULES - - Get specific schedule details [Optional]
PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID - - Create a new schedule [Optional]
PAGERDUTY_CREATE_NEW_SCHEDULE_LAYER - - Update an existing schedule [Optional]
PAGERDUTY_UPDATE_SCHEDULE_BY_ID - - View who is currently on-call [Optional]
PAGERDUTY_RETRIEVE_ONCALL_LIST - - Create temporary overrides [Optional]
PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION - - Remove an override [Optional]
PAGERDUTY_DELETE_SCHEDULE_OVERRIDE_BY_ID - - List users in a schedule [Optional]
PAGERDUTY_RETRIEVE_USERS_BY_SCHEDULE_ID - - Preview schedule changes before saving [Optional]
PAGERDUTY_PREVIEW_SCHEDULE_OBJECT
Key parameters:
- : Schedule identifier
schedule_id - : Schedule timezone (e.g., 'America/New_York')
time_zone - : Array of rotation layer configurations
schedule_layers - /
since: Date range for on-call queries (ISO 8601)until - : Override object with user, start, and end times
override
Pitfalls:
- Schedule layers define rotation order; multiple layers can overlap
- Overrides are temporary and take precedence over the normal schedule
- and
sinceare required for on-call queries to scope the time rangeuntil - Time zones must be valid IANA timezone strings
- Preview before saving complex schedule changes to verify correctness
适用场景:用户需要查看或管理随叫随到排班与轮值
工具序列:
- - 列出所有排班 [必填]
PAGERDUTY_GET_SCHEDULES - - 获取特定排班详情 [可选]
PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID - - 创建新排班 [可选]
PAGERDUTY_CREATE_NEW_SCHEDULE_LAYER - - 更新现有排班 [可选]
PAGERDUTY_UPDATE_SCHEDULE_BY_ID - - 查看当前随叫随到人员 [可选]
PAGERDUTY_RETRIEVE_ONCALL_LIST - - 创建临时覆盖规则 [可选]
PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION - - 删除覆盖规则 [可选]
PAGERDUTY_DELETE_SCHEDULE_OVERRIDE_BY_ID - - 列出排班中的用户 [可选]
PAGERDUTY_RETRIEVE_USERS_BY_SCHEDULE_ID - - 保存前预览排班变更 [可选]
PAGERDUTY_PREVIEW_SCHEDULE_OBJECT
关键参数:
- : 排班ID
schedule_id - : 排班时区(例如:'America/New_York')
time_zone - : 轮值层配置数组
schedule_layers - /
since: 随叫随到查询的日期范围(ISO 8601格式)until - : 包含用户、开始和结束时间的覆盖规则对象
override
注意事项:
- 排班层定义了轮值顺序;多个排班层可重叠
- 覆盖规则为临时规则,优先级高于正常排班
- 随叫随到查询需要和
since参数来限定时间范围until - 时区必须是有效的IANA时区字符串
- 保存复杂排班变更前,请先预览以验证正确性
5. Manage Escalation Policies
5. 升级策略管理
When to use: User wants to create or modify escalation policies
Tool sequence:
- - List all escalation policies [Required]
PAGERDUTY_FETCH_ESCALATION_POLICES_LIST - - Get policy details [Optional]
PAGERDUTY_GET_ESCALATION_POLICY_BY_ID - - Create a new policy [Optional]
PAGERDUTY_CREATE_ESCALATION_POLICY - - Update an existing policy [Optional]
PAGERDUTY_UPDATE_ESCALATION_POLICY_BY_ID - - View audit trail for a policy [Optional]
PAGERDUTY_AUDIT_ESCALATION_POLICY_RECORDS
Key parameters:
- : Policy name
name - : Array of escalation rule objects
escalation_rules - : Number of times to loop through rules before stopping (0 = no loop)
num_loops - : Delay between escalation levels
escalation_delay_in_minutes
Pitfalls:
- Each escalation rule requires at least one target (user, schedule, or team)
- defines how long before escalating to the next level
escalation_delay_in_minutes - Setting to 0 means the policy runs once and stops
num_loops - Deleting a policy fails if services still reference it
适用场景:用户需要创建或修改升级策略
工具序列:
- - 列出所有升级策略 [必填]
PAGERDUTY_FETCH_ESCALATION_POLICES_LIST - - 获取策略详情 [可选]
PAGERDUTY_GET_ESCALATION_POLICY_BY_ID - - 创建新策略 [可选]
PAGERDUTY_CREATE_ESCALATION_POLICY - - 更新现有策略 [可选]
PAGERDUTY_UPDATE_ESCALATION_POLICY_BY_ID - - 查看策略的审计日志 [可选]
PAGERDUTY_AUDIT_ESCALATION_POLICY_RECORDS
关键参数:
- : 策略名称
name - : 升级规则对象数组
escalation_rules - : 规则循环次数(0表示不循环)
num_loops - : 各升级级别之间的延迟时间(分钟)
escalation_delay_in_minutes
注意事项:
- 每个升级规则至少需要一个目标(用户、排班或团队)
- 定义了升级到下一级别的等待时间
escalation_delay_in_minutes - 将设置为0表示策略仅运行一次后停止
num_loops - 若仍有服务引用该策略,则无法删除
6. Manage Teams
6. 团队管理
When to use: User wants to create or manage PagerDuty teams
Tool sequence:
- - Create a new team [Required]
PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILS
Key parameters:
- : Team name
name - : Team description
description
Pitfalls:
- Team names must be unique within the account
- Teams are used to scope services, escalation policies, and schedules
适用场景:用户需要创建或管理PagerDuty团队
工具序列:
- - 创建新团队 [必填]
PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILS
关键参数:
- : 团队名称
name - : 团队描述
description
注意事项:
- 团队名称在账户内必须唯一
- 团队用于限定服务、升级策略和排班的作用域
Common Patterns
常见模式
ID Resolution
ID解析
Service name -> Service ID:
1. Call PAGERDUTY_RETRIEVE_LIST_OF_SERVICES
2. Find service by name in response
3. Extract id fieldSchedule name -> Schedule ID:
1. Call PAGERDUTY_GET_SCHEDULES
2. Find schedule by name in response
3. Extract id field服务名称 -> 服务ID:
1. 调用PAGERDUTY_RETRIEVE_LIST_OF_SERVICES
2. 在响应中按名称查找服务
3. 提取id字段排班名称 -> 排班ID:
1. 调用PAGERDUTY_GET_SCHEDULES
2. 在响应中按名称查找排班
3. 提取id字段Incident Lifecycle
事件生命周期
1. Incident triggered (via API, integration, or manual creation)
2. On-call user notified per escalation policy
3. User acknowledges -> status: 'acknowledged'
4. User resolves -> status: 'resolved'1. 事件触发(通过API、集成或手动创建)
2. 根据升级策略通知随叫随到用户
3. 用户确认 -> 状态: 'acknowledged'
4. 用户解决 -> 状态: 'resolved'Pagination
分页
- PagerDuty uses offset-based pagination
- Check response for boolean field
more - Use and
offsetparameterslimit - Continue until is false
more
- PagerDuty使用基于偏移量的分页
- 检查响应中的布尔字段
more - 使用和
offset参数limit - 持续请求直到为false
more
Known Pitfalls
已知注意事项
ID Formats:
- All PagerDuty IDs are alphanumeric strings (e.g., 'P1234AB')
- Service references require
type: 'service_reference' - User references require
type: 'user_reference'
Status Transitions:
- Incidents: triggered -> acknowledged -> resolved (forward only)
- Services: active, warning, critical, maintenance, disabled
Rate Limits:
- PagerDuty API enforces rate limits per account
- Implement exponential backoff on 429 responses
- Bulk operations should be spaced out
Response Parsing:
- Response data may be nested under or
datadata.data - Parse defensively with fallback patterns
- Pagination uses /
offset/limitpatternmore
ID格式:
- 所有PagerDuty ID均为字母数字字符串(例如:'P1234AB')
- 服务引用需要
type: 'service_reference' - 用户引用需要
type: 'user_reference'
状态转换:
- 事件:triggered -> acknowledged -> resolved(仅正向转换)
- 服务:active, warning, critical, maintenance, disabled
速率限制:
- PagerDuty API对每个账户实施速率限制
- 收到429响应时,请实现指数退避机制
- 批量操作应间隔执行
响应解析:
- 响应数据可能嵌套在或
data下data.data - 请使用防御性解析并设置回退模式
- 分页使用/
offset/limit模式more
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| List incidents | PAGERDUTY_FETCH_INCIDENT_LIST | statuses[], service_ids[] |
| Get incident | PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID | incident_id |
| Create incident | PAGERDUTY_CREATE_INCIDENT_RECORD | title, service |
| Update incident | PAGERDUTY_UPDATE_INCIDENT_BY_ID | incident_id, status |
| Add incident note | PAGERDUTY_POST_INCIDENT_NOTE_USING_ID | incident_id, content |
| Snooze incident | PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION | incident_id, duration |
| Get incident alerts | PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID | incident_id |
| Incident analytics | PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID | incident_id |
| List services | PAGERDUTY_RETRIEVE_LIST_OF_SERVICES | (none) |
| Get service | PAGERDUTY_RETRIEVE_SERVICE_BY_ID | service_id |
| Create service | PAGERDUTY_CREATE_NEW_SERVICE | name, escalation_policy |
| Update service | PAGERDUTY_UPDATE_SERVICE_BY_ID | service_id |
| List schedules | PAGERDUTY_GET_SCHEDULES | (none) |
| Get schedule | PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID | schedule_id |
| Get on-call | PAGERDUTY_RETRIEVE_ONCALL_LIST | since, until |
| Create schedule override | PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION | schedule_id |
| List escalation policies | PAGERDUTY_FETCH_ESCALATION_POLICES_LIST | (none) |
| Create escalation policy | PAGERDUTY_CREATE_ESCALATION_POLICY | name, escalation_rules |
| Create team | PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILS | name, description |
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 列出事件 | PAGERDUTY_FETCH_INCIDENT_LIST | statuses[], service_ids[] |
| 获取事件详情 | PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID | incident_id |
| 创建事件 | PAGERDUTY_CREATE_INCIDENT_RECORD | title, service |
| 更新事件 | PAGERDUTY_UPDATE_INCIDENT_BY_ID | incident_id, status |
| 添加事件备注 | PAGERDUTY_POST_INCIDENT_NOTE_USING_ID | incident_id, content |
| 暂停事件 | PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION | incident_id, duration |
| 获取事件告警 | PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID | incident_id |
| 事件分析 | PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID | incident_id |
| 列出服务 | PAGERDUTY_RETRIEVE_LIST_OF_SERVICES | 无 |
| 获取服务详情 | PAGERDUTY_RETRIEVE_SERVICE_BY_ID | service_id |
| 创建服务 | PAGERDUTY_CREATE_NEW_SERVICE | name, escalation_policy |
| 更新服务 | PAGERDUTY_UPDATE_SERVICE_BY_ID | service_id |
| 列出排班 | PAGERDUTY_GET_SCHEDULES | 无 |
| 获取排班详情 | PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID | schedule_id |
| 获取随叫随到人员 | PAGERDUTY_RETRIEVE_ONCALL_LIST | since, until |
| 创建排班覆盖规则 | PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION | schedule_id |
| 列出升级策略 | PAGERDUTY_FETCH_ESCALATION_POLICES_LIST | 无 |
| 创建升级策略 | PAGERDUTY_CREATE_ESCALATION_POLICY | name, escalation_rules |
| 创建团队 | PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILS | name, description |