Skip to main content
Glama

RevClamp MCP Server

Evaluate Single-Customer Stripe Basil Ghost Usage

revclamp_evaluate_ghost_usage
Read-onlyIdempotent

Evaluate whether a specific customer's AI or API usage event constitutes unpaid ghost usage across multi-subscription Stripe 2025-03-31.basil state, enforcing fail-closed pagination (has_more must be explicitly false) and configurable 0-14 day dunning grace windows. Executes as a stateless, read-only entitlement evaluator with zero side effects. Returns structuredContent containing ok, mode, statelessEphemeralAudit, tenantId, and evaluation (isGhostLeak, isGhostUsage, reason). Use this tool for real-time per-customer entitlement gating; use revclamp_audit_revenue_leakage for batch multi-customer portfolio audits.

Input Schema

NameRequiredDescriptionDefault
customerIdYesRequired Stripe customer identifier to evaluate (format example: 'cus_9s6XKzkNRiz8i3', max 64 chars).
occurredAtSecNoOptional alias for usageTimestampSec: Unix epoch timestamp in integer seconds (e.g. 1761264000) when the usage event occurred (used when usageTimestampSec is omitted).
subscriptionsYesRequired Stripe customer subscriptions payload: either a Stripe list object ({ data: [...], has_more: false }) or a raw array of up to 50 subscription objects containing id, status ('active', 'trialing', 'past_due', 'canceled', 'unpaid'), current_period_end, or items.data[].current_period_end in Unix seconds.
usageTimestampSecNoOptional Unix epoch timestamp in integer seconds (e.g. 1761264000) when the AI/API usage event occurred (defaults to current server Unix timestamp if omitted).
subscriptionsHasMoreNoPagination completeness flag (boolean). Must be explicitly set to false when passing a raw subscriptions array so RevClamp can verify no active subscription was truncated on a later page.
dunningGracePeriodDaysNoDunning grace window in integer days (valid range: 0 to 14, default: 3) after latest_invoice_failed_at during which past_due subscriptions remain entitled.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description wisely focuses on what annotations cannot express: fail-closed pagination semantics ('has_more must be explicitly false') and the 0-14 day dunning grace window that keeps past_due subscriptions entitled. It also enumerates the structuredContent return keys. Minor deduction because it restates 'stateless, read-only, zero side effects', which the annotations already declare.

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?

Three sentences, front-loaded with the evaluation purpose, then the fail-closed/dunning behavior, then the return shape and sibling routing. It is dense and jargon-heavy ('Stripe 2025-03-31.basil'), but nearly every clause carries operational meaning and nothing is padded.

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?

With no output schema, the description compensates by listing the returned structuredContent keys (ok, mode, statelessEphemeralAudit, tenantId, evaluation fields). Combined with 100% schema coverage and rich annotations, an agent has enough to call it correctly; only the failure mode for a truncated page (error vs. ok=false) is left unspecified.

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 the schema already documents every parameter including defaults and ranges, making 3 the baseline. The description does add one cross-parameter constraint (raw arrays require subscriptionsHasMore=false to avoid truncation) and the 0-14 day grace window, but these largely restate what the individual field descriptions say.

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: evaluates whether one customer's AI/API usage event is 'unpaid ghost usage' against multi-subscription Stripe basil state. It also names its scope (per-customer, real-time) explicitly against the batch sibling revclamp_audit_revenue_leakage, so it is distinguishable without opening the schema.

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 final sentence gives an explicit routing rule: 'use this tool for real-time per-customer entitlement gating; use revclamp_audit_revenue_leakage for batch multi-customer portfolio audits.' This is a direct when-to-use plus named alternative, which is exactly what an agent needs among nine revclamp siblings.

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.