Simulate Webhook Replay & Out-of-Order State Machine
revclamp_simulate_webhook_replayDeterministically 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.
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": "revclamp_simulate_webhook_replay"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| demo | No | Optional sandbox flag to run the preset replay simulation. | |
| events | No | Optional custom array of 1 to 10 webhook events ({ eventId, eventType, createdSec, subscriptionStatus, tier, currentPeriodEndSec }) in arrival order. | |
| nowSec | No | Reference evaluation timestamp in Unix seconds used to check the 72-hour idempotency window. | |
| scenarioPreset | No | Scenario preset to evaluate when custom events are omitted (default: 'out_of_order_stale_update_after_cancel'). | |
| idempotencyWindowSec | No | Deduplication and replay-acceptance window in seconds (valid range: 60 to 2592000, default: 259200 for 72 hours). |