Skip to main content
Glama

heartbeat

Verify connection liveness by sending a ping that returns server time and logs idle interval for diagnosing dead connections.

Instructions

Lightweight liveness ping. Returns server time in seconds.

conn.last_heartbeat_at is written without taking state_lock — a single-float store is GIL-atomic and this tool fires every ~10s per connection, so paying lock contention here would dominate the sweeper's cost for no correctness gain. Documented deliberate carve-out; see docs/THREADING.md.

Timed: if the server can't even respond to a heartbeat in <200ms, something is blocking the event loop and we want a log line to pin down when it started.

Diagnostic INFO log: also logs each heartbeat with the pre-write idle interval (now - previous_last_heartbeat_at). Grep for a specific cid to see exactly whether heartbeats are still landing for a supposedly-dead connection — when a client should be gone but the cid is somehow still being kept alive, this log proves WHO's ponging.

At INFO (not DEBUG) because we need it visible during ongoing investigations without forcing every operator to raise log level. Fires ~once per 10s per connected client — volume is modest.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connection_idYes
Behavior4/5

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

Despite no annotations, the description discloses key behaviors: it writes a field without locks for performance, logs at INFO level, and includes timing. This provides good insight into side effects and logging behavior.

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

Conciseness2/5

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

The description is verbose with implementation details (e.g., GIL-atomic store, locking trade-offs) that are not essential for tool selection and could be omitted or summarized.

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

Completeness3/5

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

The description covers return value and logging behavior, but omits error handling, prerequisites, and more detail on the return format. It is adequate but not thorough.

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

Parameters1/5

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

The input schema has one required parameter 'connection_id', but the description does not clarify its meaning or usage. With 0% schema description coverage, the description fails to compensate.

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

Purpose4/5

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

The first sentence clearly states the tool's purpose: 'Lightweight liveness ping. Returns server time in seconds.' This is specific and distinguishes it from sibling tools, though no explicit comparison is made.

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

Usage Guidelines2/5

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

The description mentions it fires every ~10s per connection and is used for monitoring, but does not explicitly state when an agent should invoke it or when alternatives are preferable.

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/haoyifan/Silicon-Pantheon'

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