# create_swap

Create a P2P token swap offer on the P2PSwap smart contract. Requires api_key.

Agent View of the PolicyLayer registry record for `create_swap`. HTML page: https://policylayer.com/tools/io-github-wirternow-agent-bank/create-swap

## Facts

- Tool: `create_swap`
- Server: Ai Agent Bank (`https://tdueqhfxyojmjgactdyc.supabase.co/functions/v1/mcp-server`) — https://policylayer.com/tools/io-github-wirternow-agent-bank.md
- Homepage: https://github.com/WirterNow/ai-agent-bank-mcp-server
- Risk category: Financial (Critical risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server CORS policy: *
- Server rate-limited: no
- Parameters: 6 (6 required)
- Recommended policy verdict: Approval-gated

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `api_key` | string | yes | Your api_key from register_agent |
| `creator_id` | string | yes | UUID of the agent creating the swap |
| `offer_token` | string | yes | Token symbol or address being offered (e.g. USDC) |
| `offer_amount` | number | yes | Amount of offer token |
| `request_token` | string | yes | Token symbol or address wanted (e.g. WETH) |
| `request_amount` | number | yes | Amount of requested token |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_swap",
    "arguments": {
      "api_key": "<api_key>",
      "creator_id": "<creator_id>",
      "offer_token": "<offer_token>",
      "offer_amount": 0,
      "request_token": "<request_token>",
      "request_amount": 0
    }
  }
}
```

## Why create_swap is rated Critical

This tool creates a peer-to-peer token swap on a smart contract, which constitutes a financial commitment/transaction. It operates on Polygon blockchain infrastructure involving real asset transfers (e.g., USDC). Misuse by an AI agent could result in unauthorized financial transactions that may be difficult or impossible to reverse once committed to the blockchain.

From the tool's own definition: "'Create a P2P token swap offer on the P2PSwap smart contract' — initiates a financial transaction involving token exchange on a blockchain smart contract"

Risk signals: Handles credentials or secrets (api_key)

## Use case

AI agents use create_swap to commit financial operations through Ai Agent Bank, usually the final step of a payment, billing, or trading workflow. A call moves real money.

## Recommended policy (PolicyLayer)

Verdict: **Approval-gated**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Ai Agent Bank:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "create_swap": {
      "deny_if": [
        {
          "conditions": [],
          "on_deny": "Requires human approval."
        }
      ]
    }
  }
}
```

## Other tools on Ai Agent Bank (42)

- `accept_barter` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/accept-barter.md
- `accept_swap` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/accept-swap.md
- `borrow` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/borrow.md
- `borrow_capability` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/borrow-capability.md
- `borrow_cc` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/borrow-cc.md
- `cancel_cc_order` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/cancel-cc-order.md
- `confirm_barter_delivery` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/confirm-barter-delivery.md
- `create_job` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/create-job.md
- `fill_cc_order` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/fill-cc-order.md
- `negotiate_job` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/negotiate-job.md
- `place_cc_order` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/place-cc-order.md
- `register_agent` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/register-agent.md
- `set_cost_profile` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/set-cost-profile.md
- `transfer` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/transfer.md
- `transfer_cc` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/transfer-cc.md
- `withdraw_cc` — Financial — https://policylayer.com/tools/io-github-wirternow-agent-bank/withdraw-cc.md
- `analyze_opportunity` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/analyze-opportunity.md
- `assess_credit` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/assess-credit.md
- `browse_jobs_with_economics` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/browse-jobs-with-economics.md
- `concierge_chat` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/concierge-chat.md
- `estimate_cc_price` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/estimate-cc-price.md
- `find_matching_jobs` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/find-matching-jobs.md
- `get_agent_profile` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-agent-profile.md
- `get_balance` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-balance.md
- `get_cc_balance` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-cc-balance.md
- `get_cc_credit` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-cc-credit.md
- `get_cc_history` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-cc-history.md
- `get_cc_market` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-cc-market.md
- `get_cc_orderbook` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-cc-orderbook.md
- `get_market_depth` — Read — https://policylayer.com/tools/io-github-wirternow-agent-bank/get-market-depth.md
- …and 12 more: https://policylayer.com/tools/io-github-wirternow-agent-bank.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=io-github-wirternow-agent-bank · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/io-github-wirternow-agent-bank
