Skip to main content
Glama

heartbeat

Keep your claim and leases active by sending periodic heartbeats. Automatically extends lease TTL; returns 'stale_claim' if another runner took over.

Instructions

Report that you're still alive and keep your claim + leases fresh.

Long-running agents should call this every few minutes. The runner's reset_zombies sweep uses heartbeat_at to distinguish healthy workers from crashed ones. If you hold resource leases (see requires_locks on your step), the lease expires_at is bumped by extend_leases_sec from now so the lease reaper won't steal them out from under you.

Returns {"status": "stale_claim"} if your claim token no longer matches — this means the zombie reset already repossessed your step. Stop working immediately if you see that: another runner is about to pick your step up.

Args: step_id: Your step ID. Inferred from $SORTIE_STEP_ID if unset. extend_leases_sec: Seconds of TTL to give every lease you hold. Default 900 (15 min). Set to 0 for heartbeat-only.

Returns: {"status": "ok" | "stale_claim", "step_id": N}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
step_idNo
extend_leases_secNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully carries the burden of behavioral transparency. It explains the zombie reset sweep, lease extension mechanism, return value semantics (ok vs stale_claim), and the consequence of a stale claim. This exceeds expectations for a heartbeat tool.

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?

The description is well-structured with a lead sentence, followed by paragraphs on zombie reset, lease renewal, and return values. While slightly verbose, every sentence adds value. Minor trimming could improve conciseness, but current structure is effective.

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?

Given the tool's complexity (leases, zombie reset, claim management) and that an output schema exists, the description covers all necessary aspects: calling frequency, parameter defaults, return behavior, and error handling. It is self-contained and actionable.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It explains step_id can be inferred from $SORTIE_STEP_ID and provides the default for extend_leases_sec (900) along with its purpose. This adds essential meaning beyond the raw schema.

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 'Report that you're still alive and keep your claim + leases fresh,' which is a specific verb-resource pair. It clearly defines the tool's role for long-running agents and distinguishes itself from siblings like complete_step or fail_step by focusing on liveness and lease renewal.

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

Usage Guidelines4/5

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

The description states that 'Long-running agents should call this every few minutes,' providing clear timing guidance. It also instructs to 'Stop working immediately' upon receiving a stale_claim response. While it doesn't explicitly exclude other tools, the unique purpose of heartbeat makes alternative uses obvious.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/retospect/sortie-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server