Skip to main content
Glama

AgentPay — trust routing + spend caps for x402 agents

session_create

Open a budget-capped agent session on AgentPay. Pay $0.01 USDC once — get a session_id, budget config, and gateway URL. Enforces a hard max_spend cap across all subsequent tool calls via the AgentPay SDK. The entry point for agents discovering AgentPay on Base Bazaar.

Use when: You want to start an AgentPay session with a hard spend cap and get a session_id for tracking. Not for: you only need a session for free tools — the SDK's quickstart() opens one at no cost; this call settles $0.01 on-chain. Returns: session_id, max_spend, agent_address, gateway_url, tools_endpoint, created_at, receipt (tx_hash + network) Example response: {"session_id":"f47ac10b-58cc-4372-a567-0e02b2c3d479","max_spend":"0.10","agent_address":"GBCVQCNFWPM3GDO4GPT4YEQ42ZHPY67QTJA3WN5ERQIKQDXKBX62SLNJ","label":null,"gateway_url":"https://agentpay.tools","tools_endpoint":"https://agentpay.tools/tools","created_at":"2026-05-27T12:00:00Z","receipt":{"tx_hash":"0xabc...def","network":"base","amount_usdc":"0.01"},"sdk_hint":"Use from agentpay import Session to enforce the max_spend cap client-side."}

Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)

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": {
      "max_spend": "<max_spend>"
    },
    "name": "session_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelNoOptional human-readable label for this session
max_spendYesHard budget cap in USDC for this session, e.g. '0.10'0.10
agent_addressNoYour wallet address (Stellar G... or EVM 0x...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / required
      Added value: +[
      +  "max_spend"
      +]
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the readOnlyHint=false / openWorldHint=true annotations: it discloses the $0.01 USDC x402 charge, that an unpaid call returns PaymentRequired and payment is passed via _meta x402/payment, and that the cap is enforced across all subsequent tool calls. The return field list and sample response further reveal observable behavior. It stops short of stating refund, session-expiry, or rate-limit behavior, so it is strong rather than exhaustive.

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 cost, then cleanly sectioned into 'Use when', 'Not for', and 'Returns'. The sample JSON response plus embedded sdk_hint is somewhat bulky and partially duplicates the field list above it, which costs it a point.

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?

With no output schema, the description carries the return contract itself and does so completely: field names, a full example payload, and the payment/error path. Combined with the payment disclosure and the alternative-session guidance, an agent has everything needed to call this 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 baseline is 3. The description reinforces that max_spend is a hard cap enforced across subsequent calls but adds no format or syntax detail for label or agent_address beyond what the schema already states.

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 ('Open a budget-capped agent session on AgentPay'), names the on-chain cost ($0.01 USDC), and enumerates exactly what the caller receives (session_id, budget config, gateway URL). The purpose is unambiguous and self-contained even though the sibling list contains only unrelated market-data tools.

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 'Use when' and 'Not for' clauses give both the affirmative case (need a hard spend cap plus a session_id) and the exclusion case (free tools → SDK quickstart()). That is a clear when/when-not pairing with a named alternative.

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.