Skip to main content
Glama

yax_process_x402_payment

Destructive

Process x402 payments to EVM, NEAR, or Stacks addresses. Validates spend cap and returns transaction hash with signed receipt.

Instructions

Sends an x402 payment to any EVM, NEAR, or Stacks address. Validates against your spend cap before signing. Returns transaction hash and signed receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipientYesRecipient address: EVM 0x address, Stacks SP address, or NEAR account name.
amountYesPayment amount as a decimal string, e.g. '0.50'. Validated against policy spend cap.
tokenNoToken symbol to pay with. Supported: USDC, STX, NEAR, ETH. Defaults to USDC.USDC
memoNoOptional human-readable memo attached to the payment transaction.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idNoUnique run identifier for this payment.
tx_hashNoOn-chain transaction hash of the settled payment.
statusNoPayment status: completed or denied.
proofNoFilecoin and BTFS CIDs anchoring the payment receipt permanently.
receipt_signatureNoCryptographic signature over the payment receipt.
anchored_atNoISO 8601 timestamp of receipt anchoring.

Implementation Reference

  • The main handler function `processX402Payment` that calls the remote MCP tool 'yax_process_x402_payment'. It wraps the arguments with an optional idempotency_key header and delegates to the low-level `call` method.
    processX402Payment(args: ProcessX402PaymentArgs): Promise<PaymentReceipt> {
      const headers: Record<string, string> = {};
      if (args.idempotency_key) headers["X-Idempotency-Key"] = args.idempotency_key;
      return this.call<PaymentReceipt>("yax_process_x402_payment", args as unknown as Record<string, unknown>, headers);
    }
  • The input arguments type definition for the x402 payment tool, with fields: recipient, amount, token, memo, and idempotency_key.
    export interface ProcessX402PaymentArgs {
      recipient: string;
      amount: string;
      token?: string;
      memo?: string;
      /** Pass via arg OR X-Idempotency-Key header. Dedupes 24h per (api_key, key). */
      idempotency_key?: string;
    }
  • The return type `PaymentReceipt` containing ok, run_id, tx_hash, status, proof, receipt_signature, anchored_at, idempotency_key, and idempotency_replay fields.
    export interface PaymentReceipt {
      ok: boolean;
      run_id: string | null;
      tx_hash: string | null;
      status: RunStatus;
      proof?: Proof | null;
      receipt_signature?: string | null;
      anchored_at?: string | null;
      idempotency_key?: string | null;
      idempotency_replay?: boolean;
    }
  • The tool name 'yax_process_x402_payment' is registered as a string literal passed to the low-level `call` method, which sends it as the tool name in a JSON-RPC 'tools/call' request.
    return this.call<PaymentReceipt>("yax_process_x402_payment", args as unknown as Record<string, unknown>, headers);
Behavior4/5

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

Beyond annotations (destructiveHint: true), the description adds that the tool validates against a spend cap and returns a transaction hash and signed receipt. This gives useful behavioral context without contradicting annotations.

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 description is two sentences, front-loaded with the main action, and every sentence adds value. No wasted words, highly efficient.

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 schema fully described, annotations present, and mention of return values, the tool is well specified. Minor missing details about prerequisites (e.g., wallet state) are acceptable given openWorldHint.

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?

Input schema has 100% description coverage, so parameters are well documented. The description adds no new meaning beyond the schema, earning the baseline score of 3.

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 clearly states the tool sends an x402 payment to EVM, NEAR, or Stacks addresses using a specific verb and resource. It distinguishes itself from all sibling tools, which cover different domains like audit or email sequences, leaving no ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The description implies usage for sending payments but does not explicitly state when to use it versus alternatives, such as checking wallet status or verifying receipts. It provides no exclusions or comparative guidance, leaving some ambiguity for an AI agent.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Fabio662/yieldagentx402-sdks'

If you have feedback or need assistance with the MCP directory API, please join our Discord server