Skip to main content
Glama

Fetch a paid sandbox URL

sandbox_pay

Fetches one of the sandbox's paid endpoints (HTTP 402, x402) through the spendctl sidecar, which applies the sandbox agent's budget, allowlist and approval policy, pays with the throwaway wallet if allowed, and returns the response. Use it for every paid call in the sandbox: with dryRun to see the decision without paying, with approvalId to complete a payment that was held and then approved. The endpoints are https://weather.sandbox.spendctl.dev/weather?city= ($0.01) and https://search.sandbox.spendctl.dev/search?q= ($0.02), as listed by sandbox_create and documented at https://spendctl.dev/docs/sandbox/; any other host is refused. Returns a one-line summary (HTTP status, amount paid, decision, receipt id) followed by the response body, or the refusal with its reason, or an approval id when the payment is waiting for a human. On a client that supports MCP input requests (protocol revision 2026-07-28, form elicitation) a held payment comes back as an input_required result asking the user to approve or deny, and the client's retry completes or refuses it; other clients get the approval id as text. Only sandbox hosts exist and no real funds are involved; the request is always a GET and responses are clipped at 20,000 characters. Example: url https://weather.sandbox.spendctl.dev/weather?city=Kyoto

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>",
      "url": "<url>"
    },
    "name": "sandbox_pay"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesAbsolute URL of a sandbox endpoint, e.g. https://weather.sandbox.spendctl.dev/weather?city=Kyoto
dryRunNotrue: only report what spendctl would decide; never pay
approvalIdNoThe approval id from an earlier sandbox_pay result, after approve accepted it, to complete that held payment
sandbox_idYesThe sandbox_id returned by sandbox_create (32 hex characters)
idempotencyKeyNoReuse the same key when retrying a call so the sandbox is never charged twice, e.g. "kyoto-1"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / body
      Removed value: -{
      -  "description": "Request body for POST/PUT/PATCH, up to 16 KB",
      -  "type": "string"
      -}
    • removedInput schema / properties / headers
      Removed value: -{
      -  "additionalProperties": {
      -    "type": "string"
      -  },
      -  "description": "Extra request headers, e.g. {\"accept\": \"application/json\"}",
      -  "propertyNames": {
      -    "type": "string"
      -  },
      -  "type": "object"
      -}
    • removedInput schema / properties / method
      Removed value: -{
      -  "default": "GET",
      -  "description": "HTTP method; both sandbox endpoints answer GET",
      -  "enum": [
      -    "GET",
      -    "POST",
      -    "PUT",
      -    "PATCH",
      -    "DELETE"
      -  ],
      -  "type": "string"
      -}
  2. Changed7 schema fields changed
    • changedInput schema / properties / approvalId / description
      Previous value: -"An approval id that a human approved, to retry the held payment"New value: +"The approval id from an earlier sandbox_pay result, after approve accepted it, to complete that held payment"
    • changedInput schema / properties / body / description
      Previous value: -"Request body (for POST/PUT/PATCH)"New value: +"Request body for POST/PUT/PATCH, up to 16 KB"
    • changedInput schema / properties / dryRun / description
      Previous value: -"Only report what spendctl would do; never pay"New value: +"true: only report what spendctl would decide; never pay"
    • changedInput schema / properties / headers / description
      Previous value: -"Extra request headers"New value: +"Extra request headers, e.g. {\"accept\": \"application/json\"}"
    • changedInput schema / properties / idempotencyKey / description
      Previous value: -"Reuse the same key when retrying so the sandbox is never charged twice"New value: +"Reuse the same key when retrying a call so the sandbox is never charged twice, e.g. \"kyoto-1\""
    • addedInput schema / properties / method / description
      Added value: +"HTTP method; both sandbox endpoints answer GET"
    • changedInput schema / properties / sandbox_id / description
      Previous value: -"The sandbox_id returned by sandbox_create"New value: +"The sandbox_id returned by sandbox_create (32 hex characters)"
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With readOnlyHint=false and destructiveHint=false already given, the description still adds substantial context: budget/allowlist/approval policy enforcement, the throwaway wallet, no real funds, GET-only, and a 20,000-character response clip. It also discloses the three possible outcomes (summary+body, refusal with reason, approval id) and the input_required elicitation path for capable clients. Slightly short of 5 only because the interaction between idempotencyKey and the declared idempotentHint=false is not reconciled.

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?

Front-loaded with the core action and scoping, and each sentence carries operational information rather than filler. It is a long single block, however, and the endpoint URLs are restated in the description, the schema, and the trailing example, which is mild redundancy.

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?

No output schema exists, and the description compensates by describing the return shape (one-line summary with status, amount, decision, receipt id, then body), the failure shape (refusal with reason), and the pending-approval shape (approval id or input_required result). For a tool with payment side effects and client-version-dependent behavior, nothing an agent needs before calling is missing.

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, but the prose adds real meaning: dryRun is framed as 'see the decision without paying' and approvalId as completing a held payment after approve accepted it, which clarifies the two-step approval workflow. It does not add anything beyond the schema for sandbox_id or idempotencyKey.

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 ('Fetches one of the sandbox's paid endpoints ... through the spendctl sidecar') and pins down exactly what is being fetched by listing the two concrete URLs and their prices. An agent can tell this apart from sibling tools like check_budget or approve without opening any 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?

Gives an explicit routing rule ('Use it for every paid call in the sandbox') plus the two branches that change behavior: dryRun to preview the decision without paying, and approvalId to complete a payment previously held and approved. It also states a hard exclusion ('any other host is refused') and explains the approval retry path, leaving little to inference.

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