Skip to content

capabilities / capabilityMap

The agent tool registry — one tool definition per spend action, ready to expose to any agent framework. Xpense.invoke(name, input) dispatches through capabilityMap.

ts
const capabilities: ToolDefinition[];
const capabilityMap: Record<string, ToolDefinition>;

Registered tools

NameRead-onlyDescription
x402.paynoEmit a Payment Intent for an x402 (HTTP 402) resource; signing/settlement handed downstream to xerpaai-go /x402/sign.
payment.set_defaultnoSet default payment asset, chain (CAIP-2), and address for the session.
payment.get_defaultyesRead the current default asset/chain/address.
payment.unset_defaultnoClear the default.

Each tool carries a JSON inputSchema. x402.pay accepts { accepts, from?, tier?, force? } and tier: "premium" maps to approval.mode = "auto".

ToolDefinition

ts
interface ToolDefinition {
  name: string;
  description: string;
  isReadOnly: boolean;
  inputSchema: object; // JSON Schema
  call(input: unknown, ctx: ToolContext): Promise<ToolResult>;
}

Example

ts
const result = await xpense.invoke("x402.pay", {
  accepts: { amount: "0.25", currency: "USDC", resource: "/api/inference" }
});

Proprietary software. All rights reserved.