PulseMon Skill
Monitor your cron jobs and background tasks through PulseMon.
Setup
The user needs a PulseMon API key. They can generate one at https://pulsemon.dev/dashboard/settings under "API Keys".
Store it as the environment variable PULSEMON_API_KEY.
Base URL
All API requests go to: INLINECODE1
Authentication
Every request must include the header:
CODEBLOCK0
Available Actions
List all monitors
INLINECODE2
Returns an array of monitors with their name, slug, status (up/down/waiting/paused), last ping time, and expected interval.
Get a specific monitor
INLINECODE3
Returns full monitor details including recent pings and incidents.
Create a monitor
INLINECODE4
CODEBLOCK1
Body:
CODEBLOCK2
- - name: Human-readable name (required, 1-100 characters)
- slug: URL-safe identifier, lowercase letters, numbers, and hyphens only (required, 3-60 characters)
- expectedInterval: Seconds between expected pings (required, minimum 10, maximum 2592000)
- gracePeriod: Extra seconds before alerting (optional, 0-86400, defaults to a sensible value based on the interval)
- tags: Array of string tags for organisation (optional)
- maxDuration: Max allowed run time in milliseconds (optional, null to disable). Alerts if a ping reports a duration exceeding this threshold.
Update a monitor
INLINECODE5
CODEBLOCK3
Body: any of these fields (at least one required):
- - name: string (1-100 characters)
- expectedInterval: number (10-2592000)
- gracePeriod: number (0-86400)
- isPaused: boolean
- tags: array of strings
- maxDuration: number or null (milliseconds)
Delete a monitor
INLINECODE6
Pause a monitor
INLINECODE7
Resume a monitor
INLINECODE8
List pings for a monitor
INLINECODE9
List incidents for a monitor
INLINECODE10
Ping a monitor
Pings are sent directly to the ping endpoint (no API key needed):
INLINECODE11
Optional query params:
- - status: "success" (default), "fail", or "start"
- duration: Job duration in milliseconds
INLINECODE12 with JSON body:
CODEBLOCK4
- - status=start: Signals a job has begun. Enables overlap detection. Does not reset the deadline.
- status=success: Signals the job completed. Resets the deadline.
- status=fail: Records a failure. Does not reset the deadline.
- body: Job output (up to 10 KB). Included in alert notifications.
- duration: Job run time in ms. Checked against maxDuration threshold if set.
Response Format
All responses are JSON with this shape:
CODEBLOCK5
On error:
CODEBLOCK6
Common Intervals
When the user says a time like "every hour" or "daily", convert to seconds:
- - Every minute: 60
- Every 5 minutes: 300
- Every 15 minutes: 900
- Every 30 minutes: 1800
- Every hour: 3600
- Every 6 hours: 21600
- Every 12 hours: 43200
- Daily: 86400
- Weekly: 604800
Guidelines
- - When listing monitors, show name, status, and last ping time in a readable format.
- When a monitor is "down", mention how long it's been down.
- When creating a monitor, suggest a sensible grace period if the user doesn't specify one (e.g. 10% of the interval, minimum 30 seconds).
- After creating a monitor, show the user the ping URL: INLINECODE13
- Always confirm before deleting a monitor.
- When the user says "check my monitors" or similar, use the list endpoint and summarise the results.
- Format durations in human-readable form (e.g. "2 hours ago" instead of a raw timestamp).
PulseMon 技能
通过 PulseMon 监控您的定时任务和后台作业。
设置
用户需要一个 PulseMon API 密钥。可在 https://pulsemon.dev/dashboard/settings 的API 密钥下生成。
将其存储为环境变量 PULSEMONAPIKEY。
基础 URL
所有 API 请求发送至:https://pulsemon.dev/api/v1
身份验证
每个请求必须包含以下标头:
Authorization: Bearer {PULSEMONAPIKEY}
可用操作
列出所有监控器
GET /api/v1/monitors
返回一个监控器数组,包含其名称、标识符、状态(在线/离线/等待/暂停)、最后 ping 时间和预期间隔。
获取特定监控器
GET /api/v1/monitors/{id}
返回完整的监控器详情,包括最近的 ping 记录和事件。
创建监控器
POST /api/v1/monitors
Content-Type: application/json
请求体:
json
{
name: 夜间备份,
slug: nightly-backup,
expectedInterval: 86400,
gracePeriod: 300,
tags: [production]
}
- - name:人类可读的名称(必填,1-100 个字符)
- slug:URL 安全标识符,仅限小写字母、数字和连字符(必填,3-60 个字符)
- expectedInterval:预期 ping 之间的秒数(必填,最小 10,最大 2592000)
- gracePeriod:告警前的额外秒数(可选,0-86400,默认根据间隔设置合理值)
- tags:用于组织的字符串标签数组(可选)
- maxDuration:最大允许运行时间(毫秒,可选,设为 null 则禁用)。如果 ping 报告的持续时间超过此阈值则告警。
更新监控器
PATCH /api/v1/monitors/{id}
Content-Type: application/json
请求体:以下任意字段(至少需要一个):
- - name:字符串(1-100 个字符)
- expectedInterval:数字(10-2592000)
- gracePeriod:数字(0-86400)
- isPaused:布尔值
- tags:字符串数组
- maxDuration:数字或 null(毫秒)
删除监控器
DELETE /api/v1/monitors/{id}
暂停监控器
POST /api/v1/monitors/{id}/pause
恢复监控器
POST /api/v1/monitors/{id}/resume
列出监控器的 ping 记录
GET /api/v1/monitors/{id}/pings?limit=20&offset=0
列出监控器的事件
GET /api/v1/monitors/{id}/incidents?limit=20&offset=0
Ping 监控器
Ping 直接发送到 ping 端点(无需 API 密钥):
GET https://pulsemon.dev/api/ping/{slug}
可选查询参数:
- - status:success(默认)、fail 或 start
- duration:作业持续时间(毫秒)
POST https://pulsemon.dev/api/ping/{slug} 使用 JSON 请求体:
json
{
status: success,
duration: 1234,
body: 已处理 500 条记录
}
- - status=start:表示作业已开始。启用重叠检测。不会重置截止时间。
- status=success:表示作业已完成。重置截止时间。
- status=fail:记录失败。不会重置截止时间。
- body:作业输出(最多 10 KB)。包含在告警通知中。
- duration:作业运行时间(毫秒)。如果设置了 maxDuration 阈值则进行检查。
响应格式
所有响应均为 JSON 格式,结构如下:
json
{
data: { ... },
error: null
}
错误时:
json
{
data: null,
error: { code: NOT_FOUND, message: 未找到监控器 }
}
常见间隔
当用户提到每小时或每天等时间时,转换为秒:
- - 每分钟:60
- 每 5 分钟:300
- 每 15 分钟:900
- 每 30 分钟:1800
- 每小时:3600
- 每 6 小时:21600
- 每 12 小时:43200
- 每天:86400
- 每周:604800
指南
- - 列出监控器时,以可读格式显示名称、状态和最后 ping 时间。
- 当监控器离线时,说明已离线多长时间。
- 创建监控器时,如果用户未指定宽限期,建议一个合理的值(例如间隔的 10%,最少 30 秒)。
- 创建监控器后,向用户显示 ping URL:https://pulsemon.dev/api/ping/{slug}
- 删除监控器前务必确认。
- 当用户说检查我的监控器或类似内容时,使用列表端点并汇总结果。
- 以人类可读的格式显示持续时间(例如2 小时前而不是原始时间戳)。