Skip to main content
Glama

Report Agent Heartbeat

agent_herzschlag
Destructive

Lebenszeichen einer Sitzung für eine Persona (POST /agents/herzschlag).

Wie die Konto-Brücke zwischen Claude-Sitzungen, aber über Konten und
Werkzeuge hinweg; die Wahrheit ist das Postfach.

Upsert auf (persona_slug, sitzung), setzt `zuletzt=now`. `status` ist
online/beschaeftigt/offline (Default online); `client` ist z. B.
claude-code/cursor/web/mcp/codex/mistral-vibe/sonstiges — kein
geschlossenes Enum im Vertrag (`sonstiges` deckt den Rest ab), deshalb
hier keine clientseitige Prüfung, anders als bei `status`. Der Core
glättet `client` (Ränder, Groß/Klein) und nimmt einen Wert, der nicht
in CLIENT_WERTE (routers/agents.py) steht, als `sonstiges` an -- kein
422: ein Herzschlag scheitert nicht an einem Namen.
`arbeitet_an` ist ein optionaler freier Satz.

`kontext_zeichen` macht die „Gehirn-Last" sichtbar: optionale
Zeichenzahl dessen, was die Sitzung tatsächlich geladen hat (der
SessionStart-Hook übergibt hier die Länge des geladenen Persona-Briefs
beim ersten Herzschlag). Kein Client-seitiger Zähler, keine Schätzung
hier — nur Durchreichen dessen, was der Aufrufer misst; `GET /agents`
liefert den Wert je Sitzung zurück, der Balken „Gehirn-Last" entsteht im
Core/Web, nicht hier (keine zweite Fach-Logik).

`modell`: z. B.
`claude-fable-5-1`, `claude-sonnet-5`, `cursor:<modell>` — jede Persona
gibt ihr Modell beim **ersten** Herzschlag der Sitzung mit; ein
Herzschlag ohne `modell` (jeder weitere Takt derselben Sitzung) lässt
den zuletzt gemeldeten Wert stehen, der Core überschreibt nicht mit
NULL (kein erfundener Wert — fehlt er ganz, bleibt er `null`, kein
Rückfall-String hier).

Antwort: `{"online": n, "nachrichten_offen": n}`. Herzschlag von einer
unbekannten Persona ist ein echter Fehler (404), kein Leerzustand wie bei
`gilt` — kommt als `ToolError` mit dem Core-`detail` an.

**EINE VERABSCHIEDETE STELLE BEKOMMT KEINE ANWESENHEIT: 409.** Die Absage
nennt `projekt`, `verabschiedet_am` und `nachfolger_slug`. Sie bedeutet:
die Sitzung arbeitet unter einer Identität, die es in DIESEM Projekt
nicht mehr gibt; der Slug war womöglich in einem anderen Projekt gemeint.
Die Sitzung wird dadurch nicht umbenannt. `agent_offline` bleibt erlaubt und
ist der Rückweg für eine Anwesenheit, die schon steht.

Herzschlag zählt laut Vertrag nicht als Schreiben an Wissen ("ro darf
lesen und Herzschlag senden") — der Aufruf läuft deshalb mit `rw=False`
(RO-Schlüssel, fällt auf RW zurück, wenn kein RO gesetzt ist), nicht
mit dem RW-Schlüssel wie die übrigen Schreib-Werkzeuge im MCP.

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": {
      "persona_slug": "<persona_slug>",
      "sitzung": "<sitzung>",
      "client": "<client>"
    },
    "name": "agent_herzschlag"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNoChat token returned by `persona_waehlen`. With it, the call acts as the persona of that chat; without it, as the unbound connection (Chat-Token aus `persona_waehlen`: mit ihm handelt der Aufruf als die Persona dieses Chats, ohne ihn als die ungebundene Verbindung).
clientYes
modellNo
statusNoonline
sitzungYes
arbeitet_anNo
persona_slugYes
kontext_zeichenNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Adds a lot beyond the annotations: upsert key, default `status=online`, no client-side validation of `client` (core smooths it and maps unknown values to `sonstiges` instead of returning 422), no NULL overwrite of `modell`, the 404-as-ToolError behavior, and the 409 body fields (`projekt`, `verabschiedet_am`, `nachfolger_slug`). It also discloses the auth posture (`rw=False`, RO key falling back to RW), which is useful context. The one gap is tension with the declared `destructiveHint: true`: the description stresses that nothing is destroyed and that it does not count as a write to knowledge, without explaining what the destructive flag actually covers.

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

Conciseness3/5

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

Purpose and upsert semantics are front-loaded, but the body is long and carries analogical filler ("Wie die Konto-Brücke zwischen Claude-Sitzungen… die Wahrheit ist das Postfach") and a lengthy 409 narrative that could be tightened. The rw=False paragraph is relevant but reads as internal rationale rather than call-time guidance.

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 an 8-parameter upsert with error paths, the definition is complete enough to call correctly: it covers defaults, the update-vs-no-op behavior of nullable fields, both failure modes with their payloads, and the permission posture. An output schema exists, and the description repeats the response shape only briefly, so nothing essential is missing.

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 coverage is only 13%, and the description compensates for nearly every parameter: `status` values and default, `client` as an open set with listed examples plus the non-422 smoothing rule, `arbeitet_an` as a free sentence, `kontext_zeichen` as a pass-through measurement the caller supplies (not a counter here, surfaced via `GET /agents`), and `modell` with examples and the first-beat-only rule. Only `chat` is left to the schema, and that one already carries its own description.

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?

Opens with a specific verb+resource+endpoint ("Lebenszeichen einer Sitzung für eine Persona (POST /agents/herzschlag)") and immediately names the write semantics ("Upsert auf (persona_slug, sitzung), setzt `zuletzt=now`"). It also distinguishes itself from the sibling `agent_offline`, which is called out as the return path for an already-standing presence.

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?

States explicit conditions: `modell` belongs on the first heartbeat of a session only, later beats omit it; `agent_offline` is the correct fallback when presence already exists after a 409; a heartbeat from an unknown persona is a genuine 404 rather than an empty state. Exclusion and alternative paths are both spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.