Skills

Install Agent Gateway skills to give your AI agent the ability to request TON transfers. Choose the integration method that fits your setup.

🔌

MCP Server

Model Context Protocol integration

MCP Claude Code Any MCP Client

Exposes Agent Gateway tools directly to your AI agent via MCP. The agent can request transfers, check statuses, and list pending requests — no HTTP knowledge needed.

Best for: Claude Code, Cursor, Windsurf, and any editor or agent that supports MCP servers.
1Get your token

Connect your wallet on the dashboard and create a token for your agent.

2Clone & install
git clone https://github.com/niccolocase/agent-api.git
cd agent-api/mcp && npm install
3Add to your settings

Add to .claude/settings.json or your MCP client config:

{
  "mcpServers": {
    "agent-gateway": {
      "command": "npx",
      "args": ["tsx", "/path/to/agent-api/mcp/src/index.ts"],
      "env": {
        "AGENT_GATEWAY_TOKEN": "YOUR_TOKEN_HERE",
        "AGENT_GATEWAY_API_URL": "https://api.tongateway.ai"
      }
    }
  }
}

Replace /path/to/agent-api with the actual path and paste your token.

ToolParamsDescription
request_transfer to, amountNano, payloadBoc? Queue a TON transfer for owner approval
get_request_status id Check if a request was approved, rejected, or pending
list_pending_requests List all pending transfer requests

Amount reference

TONnanoTON
0.1100000000
0.5500000000
11000000000
1010000000000

Once configured, your agent can request transfers in natural language:

You: Send 0.5 TON to EQD...abc

Claude: I'll request that transfer for you.
        [calls request_transfer with to="EQD...abc", amountNano="500000000"]

        Transfer request created (ID: abc-123).
        Please approve it in your Agent Gateway dashboard.

You: Is it confirmed?

Claude: [calls get_request_status with id="abc-123"]
        Yes, the transfer was confirmed and signed by the wallet.

Claude Code Skill

Skill file for Claude Code / OpenClaw

Skill File Claude Code OpenClaw

A skill file that teaches Claude Code how to use Agent Gateway. Drop it into your project and Claude will know the full API, tools, and best practices.

Best for: Claude Code and OpenClaw users who want the agent to understand Agent Gateway without manual prompting every time.
1Create the skills directory
mkdir -p .claude/skills
2Download the skill
curl -o .claude/skills/agent-gateway.md \
  https://raw.githubusercontent.com/niccolocase/agent-api/main/skills/agent-gateway.md
3Use it

Claude Code will automatically detect the skill. Ask it to /agent-gateway or just say "send TON" and it will know what to do.

Full content of agent-gateway.md:

---
name: agent-gateway
description: Install and use Agent Gateway — lets your AI agent
  request TON blockchain transfers that are approved by a human
  wallet owner via TON Connect
---

# Agent Gateway Skill

Agent Gateway lets you request TON transfers from a human's wallet.
You submit transfer requests, the wallet owner approves them.

## Setup

1. Get a token from https://tongateway.ai
2. Configure MCP server (see MCP Server skill above)

## Tools

| Tool                   | Description                        |
|------------------------|------------------------------------|
| request_transfer       | Queue a TON transfer for approval  |
| get_request_status     | Check request status by ID         |
| list_pending_requests  | List all pending requests          |

## Usage

request_transfer({ to: "EQD...addr", amountNano: "1000000000" })
→ 1 TON = 1,000,000,000 nanoTON

## Direct HTTP (fallback)

POST https://api.tongateway.ai/v1/safe/tx/transfer
  Authorization: Bearer TOKEN
  { "to": "0:dest...", "amountNano": "1000000000" }

## Important

- You cannot sign transactions, only request them
- Token = session, guard it like a password
- Requests expire in 5 minutes
- Token expires in 24 hours
🚀

REST API

Direct HTTP for any language or agent

Python JavaScript Any Language

Use the REST API directly when MCP is not available. Works with any language, framework, or custom agent that can make HTTP requests.

Best for: Custom trading bots, Python scripts, Node.js agents, or any platform without MCP support. Full Swagger docs
import requests

API = "https://api.tongateway.ai"
TOKEN = "your-token-here"
headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Content-Type": "application/json"
}

# Request a transfer
resp = requests.post(f"{API}/v1/safe/tx/transfer",
    headers=headers,
    json={
        "to": "EQD...destination-address",
        "amountNano": "1000000000"  # 1 TON
    }
)
req = resp.json()
print(f"Request {req['id']}: {req['status']}")

# Check status
status = requests.get(
    f"{API}/v1/safe/tx/{req['id']}",
    headers=headers
)
print(status.json()["status"])
# "pending" | "confirmed" | "rejected"
const API = "https://api.tongateway.ai";
const TOKEN = "your-token-here";
const headers = {
  "Authorization": `Bearer ${TOKEN}`,
  "Content-Type": "application/json"
};

// Request a transfer
const res = await fetch(`${API}/v1/safe/tx/transfer`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    to: "EQD...destination-address",
    amountNano: "1000000000" // 1 TON
  }),
});

const { id, status } = await res.json();
console.log(id, status); // "abc-123" "pending"

// Check status
const check = await fetch(
  `${API}/v1/safe/tx/${id}`, { headers }
);
console.log((await check.json()).status);
# Set your token
export TOKEN="your-token-here"
export API="https://api.tongateway.ai"

# Request a transfer (1 TON)
curl -X POST $API/v1/safe/tx/transfer \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "EQD...destination-address",
    "amountNano": "1000000000"
  }'

# Check status
curl $API/v1/safe/tx/REQUEST_ID \
  -H "Authorization: Bearer $TOKEN"

# List all pending
curl $API/v1/safe/tx/pending \
  -H "Authorization: Bearer $TOKEN"

Endpoints Quick Reference

All /v1/safe/* endpoints require Authorization: Bearer TOKEN. Full Swagger docs

MethodEndpointDescription
POST/v1/safe/tx/transferRequest a TON transfer
GET/v1/safe/tx/pendingList pending requests
GET/v1/safe/tx/:idGet request by ID
POST/v1/safe/tx/:id/confirmConfirm (after wallet signs)
POST/v1/safe/tx/:id/rejectReject a request