Skip to main content
Glama

topup_endpoint_with_payment

Complete an endpoint credit top-up after you have obtained a valid signed x402 payment (v2 or v1). Accepts either a dashboard PAT with mcp:endpoints:write or mcp:* or a legacy endpoint API key. If the reply is HTTP 202 with status settlement_pending (or fulfilment_pending / needs_review), the payment may already have gone through: do NOT sign a new payment; call this tool again later with the SAME paymentPayload (pending top-ups are also credited automatically). One payment tops up once: a repeat returns already_applied; reuse for another endpoint returns 409 payment_already_used (nothing charged).

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": {
      "slug": "<slug>",
      "topupAmount": "<topupAmount>",
      "paymentPayload": "<paymentPayload>"
    },
    "name": "topup_endpoint_with_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYesSlug of the endpoint to top up
apiKeyNoLegacy endpoint API key (x402_*)
accessTokenNoYour dashboard MCP personal access token (sgl_pat_*). Can be omitted when the connection sends Authorization: Bearer sgl_pat_*
topupAmountYesUSDC amount to add, minimum 1
paymentPayloadYesSigned x402 payment from the paying client (v2 relayed as PAYMENT-SIGNATURE, v1 as X-Payment), as JSON or base64 string

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / paymentPayload / description
      Previous value: -"Raw X-Payment payload returned by the paying client, as JSON or base64 string"New value: +"Signed x402 payment from the paying client (v2 relayed as PAYMENT-SIGNATURE, v1 as X-Payment), as JSON or base64 string"
  2. Changed1 schema field changed
    • changedInput schema / properties / accessToken / description
      Previous value: -"Your dashboard MCP personal access token (sgl_pat_*)"New value: +"Your dashboard MCP personal access token (sgl_pat_*). Can be omitted when the connection sends Authorization: Bearer sgl_pat_*"
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it: auth modes and required scopes (PAT with mcp:endpoints:write or mcp:*, or legacy x402_* key), a 202/pending state machine, idempotency outcomes (already_applied, 409 payment_already_used with nothing charged). That is exactly the mutation-safety context an agent needs before spending money.

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 action and precondition lead, followed by auth, then the pending/retry rules and idempotency. Dense and mostly waste-free, though the parenthetical pending-status lists make the middle sentences heavier than necessary.

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, yet the description documents the meaningful response states (202 settlement_pending / fulfilment_pending / needs_review, already_applied, 409 payment_already_used) and what each implies for the agent's next step. Nothing needed to call this payment-mutating tool correctly 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 description adds meaning the schema does not: paymentPayload must be the identical signed payload on retry, and reuse against a different endpoint is charged nothing and rejected with 409. It does not elaborate on the slug or topupAmount beyond the schema's own text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Complete an endpoint credit top-up" gives a specific verb and resource, and the clause "after you have obtained a valid signed x402 payment" positions it in sequence with the request-* siblings. It stops short of naming the sibling that produces the paymentPayload, so the routing is inferred rather than explicit.

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?

Explicit precondition (only after a valid signed x402 payment exists), explicit prohibition (do NOT sign a new payment on a 202 pending response), and explicit retry procedure (call again later with the SAME paymentPayload). It also states that pending top-ups are auto-credited, removing the ambiguity that would otherwise cause double payment.

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