Skip to main content
Glama

trw_heartbeat

Refresh a pin's heartbeat to keep it alive during long-running campaigns or to probe if the run is stale enough for checkpointing, with automatic rate limiting.

Instructions

Refresh the caller's pin heartbeat and append a heartbeat event.

Use when:

  • A long-running campaign needs to keep its pin alive between work units.

  • You want to probe whether the current run is stale enough to checkpoint.

Rate-limit: if now - last_heartbeat_ts < 60s the call short-circuits (no events.jsonl append, no pin-store write) and returns rate_limited=True so long-running loops don't spam the audit trail. Rate-limit state lives in pins.json::<pin_key>::last_heartbeat_ts so the 60s window survives server restart.

Input:

  • message: optional context string logged alongside the heartbeat event.

Output: TrwHeartbeatResultDict — on success {run_id, last_heartbeat_ts, stale_after_ts, age_hours, should_checkpoint, rate_limited}; on missing-pin {error: "no_active_pin", hint: "call trw_init or trw_adopt_run first"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It fully discloses the rate-limiting behavior, the short-circuit condition based on a 60-second window, the state persistence in pins.json, the output structure on success, and the error case for missing pin. This is a comprehensive behavioral disclosure.

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

Conciseness5/5

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

The description is appropriately sized and front-loaded with a one-line summary. It uses clear section headers (Use when, Rate-limit, Input, Output) and bullet points for readability. Every sentence adds value without waste.

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?

Despite no output schema, the description lists the result fields (run_id, last_heartbeat_ts, etc.) and error case. Given the tool's simplicity (one optional parameter), the description is complete and provides sufficient context for an AI agent to use it correctly.

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?

With schema description coverage at 0%, the description must compensate. It does so by explaining the only parameter 'message' as 'optional context string logged alongside the heartbeat event.' This adds meaning beyond the schema's default and type.

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 clearly states the tool's purpose: 'Refresh the caller's pin heartbeat and append a heartbeat event.' It uses specific verbs and resources, and given the sibling tools like trw_init, trw_checkpoint, and trw_probe, the description provides context that distinguishes it as a keep-alive mechanism for long-running campaigns.

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?

The description explicitly provides usage scenarios: 'Use when: - A long-running campaign needs to keep its pin alive between work units. - You want to probe whether the current run is stale enough to checkpoint.' This gives clear guidance on when to use this tool versus alternatives.

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/wallter/trw-mcp'

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