Skip to main content
Glama

Ucode SMS

Buy credits with USDC on Base (x402)

ucode_agent_buy_credits

Autonomous agents: buy a prepaid credit pack with USDC on Base using the x402 protocol — no account or card needed. Step 1: call with {pack, acceptLawfulUse:true} (no paymentHeader) → returns PAYMENT_REQUIRED with exact x402 requirements. Step 2: sign that payment with your x402 wallet and call again with paymentHeader → credits are added and a uc_live_ API key is returned (shown once, also stored for this MCP session). Pack ids come from ucode_agent_billing (aliases: starter, plus, pro). Only spend what the user approved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packYespackageId from ucode_agent_billing, or starter / plus / pro
paymentHeaderNoBase64 x402 payment payload (the X-PAYMENT header value) for step 2
acceptLawfulUseYesMust be true — lawful verification, QA, travel or privacy use only

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false), it discloses that no account or card is needed, that the first call returns PAYMENT_REQUIRED with x402 requirements, that credits are added on the second call, and that the uc_live_ API key is shown only once but stored for the session. That is substantive behavioral context a mutation tool needs.

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?

Front-loaded with the outcome and protocol, then the two steps in order, then the pack source and the spend constraint. Every clause carries actionable information; nothing is padding.

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?

Even with no output schema, the description covers the returns (PAYMENT_REQUIRED payload, uc_live_ key shown once) and the full call flow, which is everything an agent needs to invoke a paid, two-phase tool correctly.

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 the schema already documents all three parameters, including that pack accepts packageId or starter/plus/pro aliases and that acceptLawfulUse must be true. The description restates the same semantics and mainly adds workflow ordering rather than new per-parameter meaning, so baseline 3 is correct.

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+resource (buy a prepaid credit pack) plus the payment rail (USDC on Base via x402), which cleanly separates it from the stripe/nowpayments credit siblings. An agent can identify the tool without opening the 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?

Spells out the exact two-step call sequence (first without paymentHeader, then with the signed header), points to ucode_agent_billing as the source of pack ids, and adds the governance rule 'Only spend what the user approved.' When-to-use and prerequisites are both explicit.

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