Skip to main content
Glama

Simulate Webhook Replay & Out-of-Order State Machine

revclamp_simulate_webhook_replay
Read-onlyIdempotent

Deterministically evaluate an ordered or out-of-order sequence of 1-10 Stripe/Shopify/RevClamp subscription lifecycle webhooks against a 72-hour idempotency deduplication Set (eventId), a configurable idempotencyWindowSec (60s-2592000s, default: 259200s / 72h), and a monotonic transition timestamp guard (event.createdSec >= lastAppliedCreatedSec). Compares RevClamp's monotonic FSM against a naive overwrite-on-arrival handler to detect resurrected canceled subscriptions, stale tier downgrades, and duplicate retry side-effects. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, simulation, steps, finalStatus, finalTier, finalEntitlementDecision, naiveFinalStatus, and naiveHandlerBug.

Input Schema

NameRequiredDescriptionDefault
demoNoOptional sandbox flag to run the preset replay simulation.
eventsNoOptional custom array of 1 to 10 webhook events ({ eventId, eventType, createdSec, subscriptionStatus, tier, currentPeriodEndSec }) in arrival order.
nowSecNoReference evaluation timestamp in Unix seconds used to check the 72-hour idempotency window.
scenarioPresetNoScenario preset to evaluate when custom events are omitted (default: 'out_of_order_stale_update_after_cancel').
idempotencyWindowSecNoDeduplication and replay-acceptance window in seconds (valid range: 60 to 2592000, default: 259200 for 72 hours).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds real value beyond that: it explains the deterministic evaluation model, the 72-hour dedup Set keyed on eventId, the monotonic guard on event.createdSec, and that the operation is a statelessEphemeralAudit. It does not explain failure/`ok:false` conditions or error behavior, which keeps it from a 5.

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?

Two dense, front-loaded sentences with no filler — the core purpose and mechanism come first, then the return contract. The second sentence enumerating return fields is justified because no output schema exists. It is slightly run-on and could be split for readability, but every clause carries information.

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?

For a simulation tool with no output schema, the description does the necessary work of enumerating returned fields (ok, simulation, steps, finalStatus, naiveFinalStatus, naiveHandlerBug) and framing what the comparison detects. It stops short of describing edge behaviors such as what happens when `events` and `scenarioPreset` conflict, or what an `ok:false` result indicates.

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?

Schema coverage is 100%, so the baseline is 3; the description goes beyond the schema by explaining the semantic effect of the key parameters — the 1-10 event cap, the 60s-2592000s idempotency window with its 72h default, and the monotonic timestamp comparison rule. It reinforces rather than merely repeats the schema, though it does not clarify the interplay between `demo`, `scenarioPreset`, and `events` precedence.

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 states a specific verb and resource: evaluate a sequence of 1-10 subscription lifecycle webhooks against an idempotency dedup Set and a monotonic timestamp guard. The purpose (replay/out-of-order FSM simulation) is clearly distinct from the sibling revclamp_verify_webhook_signature, which handles signature verification, even though siblings are not named. An agent can tell immediately this is a simulation/diagnostic tool, not a write or verification tool.

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

Usage Guidelines3/5

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

Usage is implied through the inputs — pass a custom `events` array or fall back to a `scenarioPreset` — but there is no explicit 'use this when…' statement or exclusion against the sibling tools. The agent must infer that this is the right tool for replay/out-of-order scenarios rather than, say, reconciliation. Adequate but with a clear gap in routing guidance.

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.