Skip to main content
Glama

Get a heartbeat's uptime

get_heartbeat_uptime
Read-onlyIdempotent

Report a heartbeat's uptime over the last N days or a date range, both total and per UTC day, to measure job reliability and identify downtime.

Instructions

Report one heartbeat's uptime over the last N days or a date range, in total and per UTC day, to answer how reliable a job has been. Uptime is the share of time since the heartbeat was created that no incident was open; paused time is left out; a heartbeat that never pinged and had no incident has a null uptime_percentage. Returns heartbeat_id, window_start (the window's first day at 00:00 UTC, or the creation if later; null when the window is older than the plan's history), window_end (the day after its last day at 00:00 UTC, or now), uptime_percentage, downtime_seconds, observed_seconds, incident_count and days (oldest first: date, uptime_percentage, downtime_seconds, observed_seconds; days before the creation are not listed). A range entirely older than the plan's history (get_plan_usage shows history_retention_days) returns window_start null, no days, null uptime_percentage and zero counters. For the outages themselves use list_incidents with heartbeat_id; for the heartbeat's state get_heartbeat; probed monitors use get_uptime_summary.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "heartbeat_id": "<heartbeat_id>"
    },
    "name": "get_heartbeat_uptime"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast UTC date of a calendar range, YYYY-MM-DD, inclusive; needs from. Without it, or after today, the range ends today.
daysNoHow many days to cover, 1 to 1095, ending today; default 30, cut to the plan's history. Not together with from or to.
fromNoFirst UTC date of a calendar range, YYYY-MM-DD, inclusive. The range is cut to the plan's history; a range entirely older than it returns no data.
heartbeat_idYesThe heartbeat's uuid from list_heartbeats. An id that is not a heartbeat of this organization, or a deleted one, is a 404.

Output Schema

NameRequiredDescriptionDefault
daysYes
window_endYesEnd of the window: the day after its last day at 00:00 UTC, or now.
heartbeat_idYes
window_startYesStart of the window: its first day at 00:00 UTC, or the heartbeat's creation if that is later. Equal to window_end, with no days, when the window ended before the creation. Null when the window is older than the plan's history.
incident_countYesIncidents of the heartbeat that were open in the window.
downtime_secondsYesSeconds an incident of the heartbeat was open in the window while it was not paused.
observed_secondsYesSeconds of the window the heartbeat existed and was not paused; uptime is measured over this time. Never less than downtime_seconds.
uptime_percentageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.9.4
    • changedOutput schema / properties / days / items / properties / downtime_seconds / description
      Previous value: -"Seconds of the day an incident of the heartbeat was open."New value: +"Seconds of the day an incident of the heartbeat was open while it was not paused."
    • changedOutput schema / properties / days / items / properties / observed_seconds / description
      Previous value: -"Seconds of the day the heartbeat existed; uptime is measured over this time. Never less than downtime_seconds."New value: +"Seconds of the day the heartbeat existed and was not paused; uptime is measured over this time. Never less than downtime_seconds."
    • changedOutput schema / properties / downtime_seconds / description
      Previous value: -"Seconds an incident of the heartbeat was open in the window."New value: +"Seconds an incident of the heartbeat was open in the window while it was not paused."
    • changedOutput schema / properties / observed_seconds / description
      Previous value: -"Seconds of the window the heartbeat existed; uptime is measured over this time. Never less than downtime_seconds."New value: +"Seconds of the window the heartbeat existed and was not paused; uptime is measured over this time. Never less than downtime_seconds."
  2. Addedv1.9.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare a safe idempotent read, and the description goes well beyond them: uptime excludes paused time, null uptime for never-pinged heartbeats, and windows cut to the plan's history with a fully-stale range returning nulls and zero counters. Those are real behavioral traits the agent cannot get from annotations alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded and every early sentence earns its place, but the middle enumerates return fields (heartbeat_id, window_start, window_end, uptime_percentage, downtime_seconds, observed_seconds, incident_count, days) even though an output schema exists, making it longer than necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only reporting tool with clipping rules and retention edge cases, the description covers window boundaries, stale-range behavior, per-day ordering, and where to go for related data. Combined with the output schema, nothing material is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: the effective window is clipped to the heartbeat creation and to plan history retention, and an out-of-retention range has a defined null/zero result. The days-vs-from/to exclusivity is already in the schema, so the gain is meaningful but partial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Report one heartbeat's uptime') and fixes the scope ('over the last N days or a date range, in total and per UTC day'), which separates it from get_uptime_summary, get_heartbeat, and list_incidents without needing the schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes related questions elsewhere: list_incidents for the outages themselves, get_heartbeat for state, and get_uptime_summary for probed monitors. That is clear when-to-use/when-not-to-use guidance with named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.