Skip to main content
Glama

Close the account and refund the balance

close_account
DestructiveIdempotent

Closes the account and refunds what is left of the balance to the card(s) that paid, newest top-up first, less Stripe's processing fee on each payment refunded (Stripe keeps it; the account owner bears it). Call it WITHOUT confirm first: that only previews the refund per card and moves nothing. Then, only if the account owner has agreed, call again with confirm: true. Every campaign must be closed first. A refund the card refuses stays as credit, and the key keeps working while any credit remains. Once the balance is zero the key is revoked for good. Sandbox accounts: the key is revoked and nothing is refunded (the credit is notional). If Stripe does not answer, call again to finish.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyYesYour Clearvoyance API key (cv_live_… or cv_test_…), from create_account
confirmNotrue to actually close and refund. Omit or false to preview only.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses refund ordering (newest top-up first), Stripe fee bearing, the credit-retention and key-revocation lifecycle, sandbox behavior, and what to do if Stripe does not answer. It does not contradict any annotation and even reinforces idempotency by saying to call again to finish.

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

Conciseness5/5

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

The description is long but every sentence carries operational or safety-relevant information, and it is logically ordered from refund policy to call procedure to prerequisites to edge cases. The most decision-relevant facts are front-loaded.

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 a destructive, finance-affecting tool with an output schema, the description covers the full lifecycle: prerequisites, preview semantics, finalization, fee handling, refused refunds, credit behavior, key revocation, sandbox behavior, and retry on Stripe failure. Nothing needed for correct invocation is left implicit.

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?

The schema already documents both parameters at 100% coverage, so the baseline is 3. The description adds useful parameter-level nuance for confirm: it clarifies that omitting it previews per-card refunds, moves nothing, and should precede the final confirm, while also stating the refund order and fees that affect what the confirm call will do.

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 names the exact operation (close account) and the precise side effect (refund remaining balance), which separates it from sibling close_campaign. It also front-loads the action rather than restating the title, so an agent can immediately identify the tool's role.

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?

It gives an explicit two-step protocol: call without confirm to preview per-card refunds, then call with confirm: true only after the account owner agrees. It also states the prerequisite that every campaign must be closed first, effectively routing the agent to close_campaign before using this tool, and adds sandbox and retry 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.

Resources