Skip to main content
Glama

Read the mod's heartbeat

heartbeat
Read-only

Diagnose unresponsive tModLoader games by checking disk state to distinguish absent, stale, and still-loading client and server statuses.

Instructions

Why the game is not answering, for both sides at once.

launch already reads this file to decide readiness and keeps one bit of it. When a launch SUCCEEDS that is all anyone needs. When it fails, the discarded detail is the entire answer, and what comes back instead is no live heartbeat within 300s — which names the symptom and none of the four causes:

  • absent — nothing ever wrote one. The mod is not loaded, is not enabled in this install, or was built without the dev bridge. For clients this is an EMPTY clients list, not an entry saying so.

  • stale — a game ran and is no longer running. The file outlives the process, so this is indistinguishable from live to anything that only checks whether it exists.

  • live, no world — still loading. Nothing is wrong; wait longer.

  • live, world, not armed — loaded and ticking, bridge not listening.

clients is a LIST because two clients can share one save directory and the old single-client shape reported whichever wrote last. Expect an entry per client — and one more: an entry with player: null is the untokened heartbeat every client writes before its character loads, which nothing deletes and each new client overwrites. Treat it as a slot rather than as a client. A real client is the one carrying a token and an advancing polls.

Reads OFF DISK and needs no session, deliberately: a failed launch raises without storing one, so a tool that required a session could never answer the question it exists for. It is also the only tool here that is useful when nothing else is.

Both sides are returned together because "the client is silent and the server is fine" is a different diagnosis from both being silent, and asking one at a time cannot see the difference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYes
clientsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.3

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses extensive behavioral details: reads off disk, requires no session, returns both sides simultaneously, and explains the data structure nuances (the `clients` list, the `player: null` entry, and how a real client is identified). It explains why it works without a session due to failed launches not storing one. This goes far beyond the readOnlyHint annotation, providing critical context that affects how results are interpreted.

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 long but well-structured: it leads with the core purpose, then explains the failure context, enumerates the four causes with bullet points, clarifies the `clients` list format, and concludes with rationale for the design. Each sentence adds value, though it could be slightly tightened. The use of bullet points and bolded terms aids readability.

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?

The description is remarkably complete given the tool's complexity. It covers when to use it, what it returns, how to interpret the data (including edge cases like the null player entry), and why it works without a session. The output schema exists but the description adds interpretive context that schema alone cannot provide. Nothing an agent needs to call it correctly is missing.

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?

There are zero parameters, so the input schema is trivially 100% covered. The description correctly omits parameter details, and the baseline for zero parameters is 4. No additional explanation is needed, and the description doesn't attempt to fabricate parameter info.

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 function: 'Read the mod's heartbeat' and expands on its purpose as the diagnostic for why the game is not answering. It distinguishes itself from siblings by explaining it's the only tool useful when nothing else is and that it reads off disk without a session, unlike other tools that require a session. This makes the purpose unambiguous.

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 explains when to use this tool: when a launch fails and the error 'no live heartbeat within 300s' is encountered. It contrasts with `launch` which already reads the file but discards the detail, making `heartbeat` the fallback for deeper diagnosis. It also notes it's the only tool useful when nothing else is, giving strong situational guidance.

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