Skip to main content
Glama

Buy prepaid credits (Lightning or USDC)

buy_credits

Use this when you will make many calls or run feeds and want to pay once instead of per call. Omit credit_token to open a new account: the result includes a btf_ token shown ONCE, store it. Lightning: pass bundle or amount_sats (100 to 1,000,000) to get an invoice, pay it, then call again with payment_hash and credit_token to credit it. USDC on Base (x402): pass bundle or amount_usd (0.10 to 50), sign accepts[0], call again with the same amount plus x402_payment; USDC is settled before crediting. Sats pay sats prices, USDC pays USDC list prices; spend with credit_token on any paid tool. Credits are NON-REFUNDABLE; a call that fails is refunded to the balance. Paused feeds resume after credit.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "buy_credits"
  }
}

Input Schema

NameRequiredDescriptionDefault
bundleNoA preset amount; see get_pricing for the sats and USD of each.
currencyNoWith bundle: which currency to pay in.sats
amount_usdNoUSDC over x402: dollars to add (0.10 to 50), e.g. "1.00".
amount_satsNoLightning: sats to add (100 to 1,000,000). Alternative to bundle.
credit_tokenNoPrepaid token (btf_...), returned once by buy_credits or create_feed. Send it on every later feed or credit call.
payment_hashNoLightning: check this invoice and credit it if paid, instead of creating a new one.
x402_paymentNox402 payment (USDC on Base): base64 PaymentPayload signed for accepts[0] of the payment_required result. Alternative to l402_credential; also accepted in params._meta['x402/payment'].

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the generic mutation profile (readOnly=false, non-idempotent, non-destructive); the description goes well beyond that with the two-step invoice-then-credit protocol, the one-time btf_ token, USDC settlement ordering, NON-REFUNDABLE credits, refund of failed calls, and resumption of paused feeds. These are precisely the mutation consequences an agent cannot infer from the hints.

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 decision trigger, then organized by payment rail, which is the right mental model for the caller. It is dense and reads as a run-on chain of clauses, but nearly every clause carries operational information (ranges, retry instructions, token handling) rather than filler.

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 seven parameters, a two-call payment protocol, and no output schema, this definition does most of the needed work, including what the first-call result contains (btf_ token) and the refund policy. Minor gaps remain: it never says what an invoice/accepts payload looks like or that pricing must be fetched via get_pricing before choosing a bundle, though the schema field points there.

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 cross-parameter logic the schema does not: omitting credit_token opens a new account, Lightning takes bundle or amount_sats while USDC takes bundle or amount_usd, and the second call must repeat the amount with payment_hash or x402_payment. It adds sequencing and mutual-exclusivity meaning rather than restating field docs.

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 (buy prepaid credits) plus the two payment rails in the title's spirit, and the description immediately frames it as a pay-once alternative to per-call billing. An agent can distinguish it from get_credit_balance, get_pricing, and the paid data tools 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit trigger: 'Use this when you will make many calls or run feeds and want to pay once instead of per call.' It also spells out the Lightning vs USDC selection conditions and what happens when credit_token is omitted. It stops short of naming sibling tools like get_pricing as the place to compare bundles, though that pointer is carried in the schema instead.

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