Dead-man switch
heartbeatAN AGENT CANNOT DETECT ITS OWN DEATH — from the inside, 'I stopped' and 'I am about to do the next step' are the same thing. Only something outside the process can tell them apart. Each call records a beat and arms a durable alarm for expect_within_seconds. Beat again in time and the alarm simply re-arms. Miss it and the expiry actions run EXACTLY ONCE: release_leases (the same release path a live agent uses), queue_alert (one envelope into a mailbox address you nominate), mark_failed (so resume_packet reports the death as an OBSERVED fact, not a self-report). FREE — it is a write. The alert is billed only when it is collected, by the existing inbox_poll first-delivery rule; there is no second charge. FREE — this tool never charges. Authenticate with Authorization: Bearer , or pass agent_key as an argument if your host cannot set headers. Equivalent HTTP route: POST /v1/heartbeat.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | The unit of work whose liveness this tracks. Namespace-scoped, and the scope resume_packet will report the death against. Example: 'permit-review-2026-08'. | |
| disarm | No | Stop the switch instead of beating. Use this when the work finishes, or a completed job raises a false alarm. Default false. Example: 'false'. | |
| agent_id | No | Optional label for the beating instance, carried in the alert so a human can tell which worker died. <=64 chars. Example: 'worker-3'. | |
| agent_key | No | Your agent_secret, if your MCP host cannot set the Authorization header. Prefer the header. | |
| on_expiry | No | Which actions run if the next beat is late: any of 'release_leases', 'queue_alert', 'mark_failed'. Default ['mark_failed']. They always run in the order release_leases, mark_failed, queue_alert so the alert can report what was released. NOTE that release_leases can only reach leases taken with a `scope` — it reports its own blind spot rather than returning a silent empty list. Example: '["release_leases","queue_alert"]'. | |
| notify_address | No | REQUIRED with 'queue_alert'. A registered address, 'agent:<id>' or 'agent:<id>/<box>'. WRITE-ONLY: we queue an envelope into it and never read it, exactly like send(). Example: 'agent:7k2p.../alerts'. | |
| expect_within_seconds | Yes | Beat again within this many seconds or the switch fires. Min 2, max 2592000 (30 days). Example: '300'. |