pagerduty-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PagerDuty 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
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    pagerduty
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
  • 已通过
    RUBE_MANAGE_CONNECTIONS
    激活PagerDuty连接,工具包为
    pagerduty
  • 请务必先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具模式

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    pagerduty
  3. If connection is not ACTIVE, follow the returned auth link to complete PagerDuty authentication
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥——只需添加端点即可使用。
  1. 确认
    RUBE_SEARCH_TOOLS
    可响应,以此验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包
    pagerduty
  3. 若连接状态未显示为ACTIVE,请按照返回的认证链接完成PagerDuty认证
  4. 在运行任何工作流之前,确认连接状态为ACTIVE

Core Workflows

核心工作流

1. Manage Incidents

1. 事件管理

When to use: User wants to create, update, acknowledge, or resolve incidents
Tool sequence:
  1. PAGERDUTY_FETCH_INCIDENT_LIST
    - List incidents with filters [Required]
  2. PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID
    - Get specific incident details [Optional]
  3. PAGERDUTY_CREATE_INCIDENT_RECORD
    - Create a new incident [Optional]
  4. PAGERDUTY_UPDATE_INCIDENT_BY_ID
    - Update incident status or assignment [Optional]
  5. PAGERDUTY_POST_INCIDENT_NOTE_USING_ID
    - Add a note to an incident [Optional]
  6. PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION
    - Snooze an incident for a period [Optional]
Key parameters:
  • statuses[]
    : Filter by status ('triggered', 'acknowledged', 'resolved')
  • service_ids[]
    : Filter by service IDs
  • urgencies[]
    : Filter by urgency ('high', 'low')
  • title
    : Incident title (for creation)
  • service
    : Service object with
    id
    and
    type
    (for creation)
  • status
    : New status for update operations
Pitfalls:
  • Incident creation requires a
    service
    object with both
    id
    and
    type: 'service_reference'
  • Status transitions follow: triggered -> acknowledged -> resolved
  • Cannot transition from resolved back to triggered directly
  • PAGERDUTY_UPDATE_INCIDENT_BY_ID
    requires the incident ID as a path parameter
  • Snooze duration is in seconds; the incident re-triggers after the snooze period
适用场景:用户需要创建、更新、确认或解决事件
工具序列
  1. PAGERDUTY_FETCH_INCIDENT_LIST
    - 按筛选条件列出事件 [必填]
  2. PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_ID
    - 获取特定事件详情 [可选]
  3. PAGERDUTY_CREATE_INCIDENT_RECORD
    - 创建新事件 [可选]
  4. PAGERDUTY_UPDATE_INCIDENT_BY_ID
    - 更新事件状态或分配对象 [可选]
  5. PAGERDUTY_POST_INCIDENT_NOTE_USING_ID
    - 为事件添加备注 [可选]
  6. PAGERDUTY_SNOOZE_INCIDENT_BY_DURATION
    - 将事件暂停指定时长 [可选]
关键参数
  • statuses[]
    : 按状态筛选('triggered', 'acknowledged', 'resolved')
  • service_ids[]
    : 按服务ID筛选
  • urgencies[]
    : 按紧急程度筛选('high', 'low')
  • title
    : 事件标题(用于创建事件)
  • service
    : 包含
    id
    type
    的服务对象(用于创建事件)
  • status
    : 更新操作的新状态
注意事项
  • 创建事件时,
    service
    对象必须同时包含
    id
    type: 'service_reference'
  • 状态转换流程:triggered -> acknowledged -> resolved
  • 无法从resolved状态直接转换回triggered状态
  • PAGERDUTY_UPDATE_INCIDENT_BY_ID
    需要将事件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:
  1. PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID
    - List alerts for an incident [Required]
  2. PAGERDUTY_GET_INCIDENT_ALERT_DETAILS
    - Get details of a specific alert [Optional]
  3. PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID
    - Get incident analytics/metrics [Optional]
Key parameters:
  • incident_id
    : The incident ID
  • alert_id
    : Specific alert ID within the incident
  • statuses[]
    : Filter alerts by status
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
适用场景:用户需要查看事件内的告警或分析事件指标
工具序列
  1. PAGERDUTY_GET_ALERTS_BY_INCIDENT_ID
    - 列出事件的所有告警 [必填]
  2. PAGERDUTY_GET_INCIDENT_ALERT_DETAILS
    - 获取特定告警的详情 [可选]
  3. PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_ID
    - 获取事件分析/指标数据 [可选]
关键参数
  • incident_id
    : 事件ID
  • alert_id
    : 事件内的特定告警ID
  • statuses[]
    : 按状态筛选告警
注意事项
  • 一个事件可包含多个告警;每个告警有自己的状态
  • 告警ID的作用域为所属事件
  • 分析数据包含响应时间、参与指标和解决时间

3. Manage Services

3. 服务管理

When to use: User wants to create, update, or list services
Tool sequence:
  1. PAGERDUTY_RETRIEVE_LIST_OF_SERVICES
    - List all services [Required]
  2. PAGERDUTY_RETRIEVE_SERVICE_BY_ID
    - Get service details [Optional]
  3. PAGERDUTY_CREATE_NEW_SERVICE
    - Create a new technical service [Optional]
  4. PAGERDUTY_UPDATE_SERVICE_BY_ID
    - Update service configuration [Optional]
  5. PAGERDUTY_CREATE_INTEGRATION_FOR_SERVICE
    - Add an integration to a service [Optional]
  6. PAGERDUTY_CREATE_BUSINESS_SERVICE
    - Create a business service [Optional]
  7. PAGERDUTY_UPDATE_BUSINESS_SERVICE_BY_ID
    - Update a business service [Optional]
Key parameters:
  • name
    : Service name
  • escalation_policy
    : Escalation policy object with
    id
    and
    type
  • alert_creation
    : Alert creation mode ('create_alerts_and_incidents' or 'create_incidents')
  • status
    : Service status ('active', 'warning', 'critical', 'maintenance', 'disabled')
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
适用场景:用户需要创建、更新或列出服务
工具序列
  1. PAGERDUTY_RETRIEVE_LIST_OF_SERVICES
    - 列出所有服务 [必填]
  2. PAGERDUTY_RETRIEVE_SERVICE_BY_ID
    - 获取服务详情 [可选]
  3. PAGERDUTY_CREATE_NEW_SERVICE
    - 创建新的技术服务 [可选]
  4. PAGERDUTY_UPDATE_SERVICE_BY_ID
    - 更新服务配置 [可选]
  5. PAGERDUTY_CREATE_INTEGRATION_FOR_SERVICE
    - 为服务添加集成 [可选]
  6. PAGERDUTY_CREATE_BUSINESS_SERVICE
    - 创建业务服务 [可选]
  7. PAGERDUTY_UPDATE_BUSINESS_SERVICE_BY_ID
    - 更新业务服务 [可选]
关键参数
  • name
    : 服务名称
  • escalation_policy
    : 包含
    id
    type
    的升级策略对象
  • alert_creation
    : 告警创建模式('create_alerts_and_incidents' 或 'create_incidents')
  • status
    : 服务状态('active', 'warning', 'critical', 'maintenance', 'disabled')
注意事项
  • 创建服务需要已存在的升级策略
  • 业务服务与技术服务不同;它们代表业务层面的分组
  • 服务集成定义了告警的创建方式(邮件、API、事件)
  • 禁用服务将停止该服务的所有事件创建

4. Manage Schedules and On-Call

4. 排班与随叫随到管理

When to use: User wants to view or manage on-call schedules and rotations
Tool sequence:
  1. PAGERDUTY_GET_SCHEDULES
    - List all schedules [Required]
  2. PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID
    - Get specific schedule details [Optional]
  3. PAGERDUTY_CREATE_NEW_SCHEDULE_LAYER
    - Create a new schedule [Optional]
  4. PAGERDUTY_UPDATE_SCHEDULE_BY_ID
    - Update an existing schedule [Optional]
  5. PAGERDUTY_RETRIEVE_ONCALL_LIST
    - View who is currently on-call [Optional]
  6. PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION
    - Create temporary overrides [Optional]
  7. PAGERDUTY_DELETE_SCHEDULE_OVERRIDE_BY_ID
    - Remove an override [Optional]
  8. PAGERDUTY_RETRIEVE_USERS_BY_SCHEDULE_ID
    - List users in a schedule [Optional]
  9. PAGERDUTY_PREVIEW_SCHEDULE_OBJECT
    - Preview schedule changes before saving [Optional]
Key parameters:
  • schedule_id
    : Schedule identifier
  • time_zone
    : Schedule timezone (e.g., 'America/New_York')
  • schedule_layers
    : Array of rotation layer configurations
  • since
    /
    until
    : Date range for on-call queries (ISO 8601)
  • override
    : Override object with user, start, and end times
Pitfalls:
  • Schedule layers define rotation order; multiple layers can overlap
  • Overrides are temporary and take precedence over the normal schedule
  • since
    and
    until
    are required for on-call queries to scope the time range
  • Time zones must be valid IANA timezone strings
  • Preview before saving complex schedule changes to verify correctness
适用场景:用户需要查看或管理随叫随到排班与轮值
工具序列
  1. PAGERDUTY_GET_SCHEDULES
    - 列出所有排班 [必填]
  2. PAGERDUTY_RETRIEVE_SCHEDULE_BY_ID
    - 获取特定排班详情 [可选]
  3. PAGERDUTY_CREATE_NEW_SCHEDULE_LAYER
    - 创建新排班 [可选]
  4. PAGERDUTY_UPDATE_SCHEDULE_BY_ID
    - 更新现有排班 [可选]
  5. PAGERDUTY_RETRIEVE_ONCALL_LIST
    - 查看当前随叫随到人员 [可选]
  6. PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATION
    - 创建临时覆盖规则 [可选]
  7. PAGERDUTY_DELETE_SCHEDULE_OVERRIDE_BY_ID
    - 删除覆盖规则 [可选]
  8. PAGERDUTY_RETRIEVE_USERS_BY_SCHEDULE_ID
    - 列出排班中的用户 [可选]
  9. PAGERDUTY_PREVIEW_SCHEDULE_OBJECT
    - 保存前预览排班变更 [可选]
关键参数
  • schedule_id
    : 排班ID
  • time_zone
    : 排班时区(例如:'America/New_York')
  • schedule_layers
    : 轮值层配置数组
  • since
    /
    until
    : 随叫随到查询的日期范围(ISO 8601格式)
  • override
    : 包含用户、开始和结束时间的覆盖规则对象
注意事项
  • 排班层定义了轮值顺序;多个排班层可重叠
  • 覆盖规则为临时规则,优先级高于正常排班
  • 随叫随到查询需要
    since
    until
    参数来限定时间范围
  • 时区必须是有效的IANA时区字符串
  • 保存复杂排班变更前,请先预览以验证正确性

5. Manage Escalation Policies

5. 升级策略管理

When to use: User wants to create or modify escalation policies
Tool sequence:
  1. PAGERDUTY_FETCH_ESCALATION_POLICES_LIST
    - List all escalation policies [Required]
  2. PAGERDUTY_GET_ESCALATION_POLICY_BY_ID
    - Get policy details [Optional]
  3. PAGERDUTY_CREATE_ESCALATION_POLICY
    - Create a new policy [Optional]
  4. PAGERDUTY_UPDATE_ESCALATION_POLICY_BY_ID
    - Update an existing policy [Optional]
  5. PAGERDUTY_AUDIT_ESCALATION_POLICY_RECORDS
    - View audit trail for a policy [Optional]
Key parameters:
  • name
    : Policy name
  • escalation_rules
    : Array of escalation rule objects
  • num_loops
    : Number of times to loop through rules before stopping (0 = no loop)
  • escalation_delay_in_minutes
    : Delay between escalation levels
Pitfalls:
  • Each escalation rule requires at least one target (user, schedule, or team)
  • escalation_delay_in_minutes
    defines how long before escalating to the next level
  • Setting
    num_loops
    to 0 means the policy runs once and stops
  • Deleting a policy fails if services still reference it
适用场景:用户需要创建或修改升级策略
工具序列
  1. PAGERDUTY_FETCH_ESCALATION_POLICES_LIST
    - 列出所有升级策略 [必填]
  2. PAGERDUTY_GET_ESCALATION_POLICY_BY_ID
    - 获取策略详情 [可选]
  3. PAGERDUTY_CREATE_ESCALATION_POLICY
    - 创建新策略 [可选]
  4. PAGERDUTY_UPDATE_ESCALATION_POLICY_BY_ID
    - 更新现有策略 [可选]
  5. PAGERDUTY_AUDIT_ESCALATION_POLICY_RECORDS
    - 查看策略的审计日志 [可选]
关键参数
  • name
    : 策略名称
  • escalation_rules
    : 升级规则对象数组
  • num_loops
    : 规则循环次数(0表示不循环)
  • escalation_delay_in_minutes
    : 各升级级别之间的延迟时间(分钟)
注意事项
  • 每个升级规则至少需要一个目标(用户、排班或团队)
  • escalation_delay_in_minutes
    定义了升级到下一级别的等待时间
  • num_loops
    设置为0表示策略仅运行一次后停止
  • 若仍有服务引用该策略,则无法删除

6. Manage Teams

6. 团队管理

When to use: User wants to create or manage PagerDuty teams
Tool sequence:
  1. PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILS
    - Create a new team [Required]
Key parameters:
  • name
    : Team name
  • description
    : Team description
Pitfalls:
  • Team names must be unique within the account
  • Teams are used to scope services, escalation policies, and schedules
适用场景:用户需要创建或管理PagerDuty团队
工具序列
  1. 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 field
Schedule 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
    more
    boolean field
  • Use
    offset
    and
    limit
    parameters
  • Continue until
    more
    is false
  • PagerDuty使用基于偏移量的分页
  • 检查响应中的
    more
    布尔字段
  • 使用
    offset
    limit
    参数
  • 持续请求直到
    more
    为false

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
    data
    or
    data.data
  • Parse defensively with fallback patterns
  • Pagination uses
    offset
    /
    limit
    /
    more
    pattern
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

快速参考

TaskTool SlugKey Params
List incidentsPAGERDUTY_FETCH_INCIDENT_LISTstatuses[], service_ids[]
Get incidentPAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_IDincident_id
Create incidentPAGERDUTY_CREATE_INCIDENT_RECORDtitle, service
Update incidentPAGERDUTY_UPDATE_INCIDENT_BY_IDincident_id, status
Add incident notePAGERDUTY_POST_INCIDENT_NOTE_USING_IDincident_id, content
Snooze incidentPAGERDUTY_SNOOZE_INCIDENT_BY_DURATIONincident_id, duration
Get incident alertsPAGERDUTY_GET_ALERTS_BY_INCIDENT_IDincident_id
Incident analyticsPAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_IDincident_id
List servicesPAGERDUTY_RETRIEVE_LIST_OF_SERVICES(none)
Get servicePAGERDUTY_RETRIEVE_SERVICE_BY_IDservice_id
Create servicePAGERDUTY_CREATE_NEW_SERVICEname, escalation_policy
Update servicePAGERDUTY_UPDATE_SERVICE_BY_IDservice_id
List schedulesPAGERDUTY_GET_SCHEDULES(none)
Get schedulePAGERDUTY_RETRIEVE_SCHEDULE_BY_IDschedule_id
Get on-callPAGERDUTY_RETRIEVE_ONCALL_LISTsince, until
Create schedule overridePAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATIONschedule_id
List escalation policiesPAGERDUTY_FETCH_ESCALATION_POLICES_LIST(none)
Create escalation policyPAGERDUTY_CREATE_ESCALATION_POLICYname, escalation_rules
Create teamPAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILSname, description
任务工具标识关键参数
列出事件PAGERDUTY_FETCH_INCIDENT_LISTstatuses[], service_ids[]
获取事件详情PAGERDUTY_RETRIEVE_INCIDENT_BY_INCIDENT_IDincident_id
创建事件PAGERDUTY_CREATE_INCIDENT_RECORDtitle, service
更新事件PAGERDUTY_UPDATE_INCIDENT_BY_IDincident_id, status
添加事件备注PAGERDUTY_POST_INCIDENT_NOTE_USING_IDincident_id, content
暂停事件PAGERDUTY_SNOOZE_INCIDENT_BY_DURATIONincident_id, duration
获取事件告警PAGERDUTY_GET_ALERTS_BY_INCIDENT_IDincident_id
事件分析PAGERDUTY_FETCH_INCIDENT_ANALYTICS_BY_IDincident_id
列出服务PAGERDUTY_RETRIEVE_LIST_OF_SERVICES
获取服务详情PAGERDUTY_RETRIEVE_SERVICE_BY_IDservice_id
创建服务PAGERDUTY_CREATE_NEW_SERVICEname, escalation_policy
更新服务PAGERDUTY_UPDATE_SERVICE_BY_IDservice_id
列出排班PAGERDUTY_GET_SCHEDULES
获取排班详情PAGERDUTY_RETRIEVE_SCHEDULE_BY_IDschedule_id
获取随叫随到人员PAGERDUTY_RETRIEVE_ONCALL_LISTsince, until
创建排班覆盖规则PAGERDUTY_CREATE_SCHEDULE_OVERRIDES_CONFIGURATIONschedule_id
列出升级策略PAGERDUTY_FETCH_ESCALATION_POLICES_LIST
创建升级策略PAGERDUTY_CREATE_ESCALATION_POLICYname, escalation_rules
创建团队PAGERDUTY_CREATE_NEW_TEAM_WITH_DETAILSname, description