Skip to main content
Glama
@asterpay/mcp-server

@asterpay/mcp-server

by petteri74dev

set_budget

Activate or create a prepaid spending budget with a hard cap so an AI agent can pay x402 APIs; a human funds it once via USDC on Base.

Instructions

Activate a prepaid budget (AsterPay /budget) so the agent can spend on paid x402 APIs with a hard cap. Three modes: (1) pass an existing budget token (bud_...) to activate it; (2) pass amount_usd + tx_hash + wallet after your HUMAN sent the USDC, to create a new budget; (3) pass nothing to get funding instructions. An agent cannot grant itself money — a human must make the one-time USDC transfer (1-500 USDC on Base). Credited 1:1, no platform fee. Funding wallet is sanctions-screened (Chainalysis). No API key needed.

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": "set_budget"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenNoExisting budget token (bud_...)
walletNoWallet the payment was sent from (0x...)
tx_hashNoTransaction hash of the USDC transfer (0x...)
amount_usdNoUSDC amount the human sent (1-500)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations at all, this description carries the full behavioral burden and does so well: hard spending cap, the 1-500 USDC range on Base, 1:1 crediting with no platform fee, Chainalysis sanctions screening of the funding wallet, and no API key requirement. What it does not disclose is what activation returns (presumably a new budget token) or how repeat activation or failed/screened transfers behave, so a small but real gap remains.

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?

The mode list is front-loaded and numbered, so an agent can map its situation to a branch in one pass. Every clause carries operational weight (cap, chain, range, fee treatment, screening, auth requirement), and there is no filler or repetition.

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?

For a funding/activation mutation with zero annotations and no output schema, the description covers prerequisites, limits, custody model and compliance checks thoroughly. The one thing left unexplained is the response — particularly the budget token an agent would need for subsequent spend calls — which is exactly what a missing output schema would otherwise have covered.

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 each of the four parameters is already documented individually, which sets the baseline at 3. The description does add genuine combinatorial meaning the schema cannot express — that token stands alone as mode 1, while amount_usd, wallet and tx_hash must be supplied together in mode 2 after the human's transfer — but it leans on the schema for individual field meaning.

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?

The description names a specific verb and resource ('Activate a prepaid budget') and immediately scopes it to spending on paid x402 APIs with a hard cap, which clearly separates it from the sibling get_budget_status. It then enumerates the three distinct operating modes, so an agent knows exactly which variant of the operation it is invoking before 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?

Usage is spelled out as three explicit, mutually exclusive conditions: pass a bud_ token to activate, pass amount_usd + tx_hash + wallet after the human has sent USDC, or pass nothing to get funding instructions. It also states an important boundary ('An agent cannot grant itself money — a human must make the one-time USDC transfer'), which prevents a common misuse.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.