Skip to main content
Glama

get_replication_divergence

Track per-replica offset gaps and divergence events to determine whether a replica is falling behind under write load, if the gap is growing, and whether primary and replica agree.

Instructions

Get replication divergence for a primary: the per-replica offset gap series (bytes behind as the primary sees it, write rate, seconds behind, replicaGapBytes as the replica reports it with replicaView saying whether it could be read (ok, unreachable, replid_mismatch, not_replica, or null when it was not sampled), live alert level, behind when it lags under the alert thresholds or has an event left open by a restart, or unobserved when the replica is not connected) and the divergence events from the anomaly store; eventsUnavailable: true means the events could not be read, not that there are none. Use when a replica is falling behind under write load, to see whether the gap is growing, at a ceiling, or not closing after the burst, and whether the replica agrees with the primary on how far behind it is. Companion to get_anomalies.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_replication_divergence"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax divergence events to return (default 100)
startTimeNoStart time (Unix timestamp ms; default 1h ago for the gap series, 24h ago for events)
instanceIdNoOptional instance ID override

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.54.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it explains each reported field, the `replicaView` states (`ok`, `unreachable`, `replid_mismatch`, `not_replica`, null), the `behind`/`unobserved` conditions, and the critical `eventsUnavailable: true` caveat that distinguishes read failure from absence of events. It does not cover permissions, cost, or sampling/pagination behavior.

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?

The purpose is front-loaded, but the body is a single sprawling sentence with deeply nested parentheses, making the enumerated field semantics hard to parse on a first read. Every element is informative, yet the packaging costs clarity that a short bulleted or multi-sentence structure would have preserved.

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

Completeness4/5

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

No output schema exists, so the description must explain return structure — and it does so thoroughly, including error-ish states and the event-store caveat. What remains thin is operational framing (primary selection, whether instanceId is required in multi-instance setups), which matters for a tool whose scope is 'a primary'.

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

Parameters3/5

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

Schema description coverage is 100%, so limit, startTime, and instanceId are already documented, including the differing defaults (1h for the series vs 24h for events). The description adds nothing about how to scope a query or what instanceId override means, so the baseline of 3 applies.

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?

States a specific verb and resource ('Get replication divergence for a primary') and immediately enumerates what is returned (per-replica offset gap series, events from the anomaly store). It also positions itself against a sibling ('Companion to get_anomalies'), so an agent can separate the two without opening schemas.

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?

Gives a concrete triggering scenario (a replica falling behind under write load) and the diagnostic questions it answers (gap growing, at a ceiling, not closing after the burst, replica vs primary agreement). It stops short of stating when NOT to use it or naming an explicit alternative beyond the vague 'companion' relationship.

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