Skip to main content
Glama

Withdraw a held sandbox payment

withdraw_approval
Idempotent

Takes back a payment that sandbox_pay reported as held, as a real agent does when the task that needed the payment was cancelled or superseded: nothing is paid, the approval closes as withdrawn (distinct from deny), a later approve on that id is refused and await_approval answers withdrawn at once. Use it with an approval id from this sandbox; a new sandbox_pay call opens a fresh approval if the payment is wanted after all. Withdrawing an id that was already decided reports that decision as an error.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sandbox_id": "<sandbox_id>",
      "approvalId": "<approvalId>"
    },
    "name": "withdraw_approval"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoOptional reason recorded with the withdrawal, e.g. "task cancelled", up to 200 characters
approvalIdYesThe approval id returned by sandbox_pay in its "waiting for approval" result (Approval id: ...)
sandbox_idYesThe sandbox_id returned by sandbox_create (32 hex characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give the generic safety profile (not read-only, idempotent, non-destructive); the description adds real semantics: nothing is paid, the approval closes as withdrawn, a later approve on that id is refused, await_approval returns withdrawn immediately, and a stale id errors. These downstream consequences are exactly what an agent cannot get from structured fields.

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?

The effect and the deny distinction are front-loaded, followed by the id-sourcing guidance and the error case. The first sentence is long and clause-heavy, but every clause carries distinct behavioral information, so there is little waste.

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 non-read-only, idempotent, non-destructive state-transition tool with full schema coverage and no output schema, the description covers effect, distinctness from siblings, follow-on state, and failure mode. Nothing an agent needs in order to call it correctly is missing.

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 all three parameters (approvalId, sandbox_id, note) are already documented in the schema. The description only adds that the approval id must come from this sandbox, which is marginal over what the schema states, so baseline 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 ('takes back a payment that sandbox_pay reported as held') and immediately scopes the effect: nothing is paid, the approval closes as withdrawn. It explicitly marks withdrawn as distinct from deny, which is the key sibling it must be separated from.

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?

Names the triggering condition (task cancelled or superseded), the alternative path if payment is still wanted ('a new sandbox_pay call opens a fresh approval'), and the error case for an already-decided id. An agent has no inference left to make about when to pick this over approve or await_approval.

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