> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenarch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tools Reference

> Reference for the three Xenarch MCP server tools — check x402 payment gates, pay USDC micropayments on Base, and query agent payment history.

The Xenarch MCP server exposes three tools over the Model Context Protocol. Each is callable by Claude Desktop, Claude Code, or any MCP-compatible agent. Below: full input/output schemas and usage examples.

## xenarch\_check\_gate

Check if a URL or domain has an x402 payment gate.

**Input:**

| Parameter | Type   | Description                                                                     |
| --------- | ------ | ------------------------------------------------------------------------------- |
| `url`     | string | URL or domain to check. Accepts `https://example.com/article` or `example.com`. |

**Output (gated):**

```json theme={null}
{
  "gated": true,
  "gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
  "price_usd": "0.003",
  "splitter": "0xC6D3a6B6fcCD6319432CDB72819cf317E88662ae",
  "collector": "0xabc123...publisher_wallet",
  "network": "base",
  "asset": "USDC",
  "protocol": "x402"
}
```

**Output (not gated):**

```json theme={null}
{
  "gated": false,
  "message": "No Xenarch gate found for example.com"
}
```

## xenarch\_pay

Execute a USDC micropayment on Base L2 to access gated content.

**Input:**

| Parameter | Type   | Required | Description                                                      |
| --------- | ------ | -------- | ---------------------------------------------------------------- |
| `url`     | string | Yes      | URL or domain to pay for. Must have an active gate.              |
| `amount`  | string | No       | Override amount in USD (e.g., `"0.01"`). Defaults to gate price. |

**Output:**

```json theme={null}
{
  "success": true,
  "tx_hash": "0xdef456...abc789",
  "block_number": 28451023,
  "amount_usd": "0.003",
  "url": "example.com",
  "access_token": "eyJhbGciOiJIUzI1NiJ9...",
  "expires_at": "2026-04-10T15:05:00Z",
  "wallet": "0x123...your_wallet"
}
```

**Flow:**

1. Checks for active gate (calls `xenarch_check_gate` internally)
2. Verifies USDC balance
3. Approves USDC on the splitter contract
4. Calls `split(collector, amount)` on-chain
5. Submits tx hash to the verify endpoint
6. Returns access token

## xenarch\_get\_history

List past USDC micropayments made by this wallet.

**Input:**

| Parameter | Type   | Required | Description                                             |
| --------- | ------ | -------- | ------------------------------------------------------- |
| `domain`  | string | No       | Filter by domain (e.g., `"example.com"`). Omit for all. |
| `limit`   | number | No       | Max records (1-100, default 10).                        |

**Output:**

```json theme={null}
{
  "payments": [
    {
      "domain": "example.com",
      "amount_usd": "0.003",
      "tx_hash": "0xdef456...abc789",
      "paid_at": "2026-04-10T14:35:00Z"
    }
  ],
  "total_spent_usd": "0.003000",
  "count": 1,
  "wallet": "0x123...your_wallet"
}
```
