Agent Gateway
Agent Gateway gives you 16 tools to interact with TON blockchain. Check balances, view tokens/NFTs, send transfers, resolve .ton names, place DEX orders, and deploy autonomous agent wallets.
MCP package: @tongateway/mcp (install via npx -y @tongateway/mcp)
Authentication
If you get "No token configured" errors, authenticate first:
- 1. Call
auth.request — you'll get a one-time link - Ask the user to open the link and connect their wallet
- Call
auth.get_token with the authId — you'll get a token - All other tools now work. Token persists across restarts.
Tools
Wallet
| Tool | Params | Description |
|---|
| INLINECODE4 | — | Wallet address, TON balance, account status |
| INLINECODE5 |
— | All token balances (USDT, NOT, DOGS, etc.) |
|
wallet.transactions |
limit? (number) | Recent transaction history |
|
wallet.nfts | — | NFTs owned by the wallet |
Transfers (Safe — requires wallet approval)
| Tool | Params | Description |
|---|
| INLINECODE9 | INLINECODE10 , amountNano, payload?, INLINECODE13 | Queue a TON transfer for owner approval |
| INLINECODE14 |
id | Check status: pending, confirmed, rejected, expired |
|
transfer.pending | — | List all pending transfer requests |
Lookup
| Tool | Params | Description |
|---|
| INLINECODE17 | INLINECODE18 | Resolve .ton domain to address. ALWAYS use before transfer when user gives a .ton name |
| INLINECODE19 |
currencies? | TON price in USD/EUR/etc. |
DEX (open4dev order book)
| Tool | Params | Description |
|---|
| INLINECODE21 | INLINECODE22 , toToken, amount, INLINECODE25 | Place a limit order. Price is human-readable (e.g. 20 = "1 USDT = 20 AGNT") |
| INLINECODE26 |
— | List available trading pairs |
Agent Wallet (Autonomous — NO approval needed)
| Tool | Params | Description |
|---|
| INLINECODE27 | — | Deploy a dedicated wallet contract. WARNING: agent can spend funds without approval |
| INLINECODE28 |
walletAddress,
to,
amountNano | Send TON directly from agent wallet |
|
agent_wallet.info |
walletAddress? | Balance, seqno, status. Omit address to list all |
Auth
| Tool | Params | Description |
|---|
| INLINECODE34 | INLINECODE35 | Generate a one-time auth link |
| INLINECODE36 |
authId | Retrieve token after user connects wallet |
Amount conversion
Amounts are in nanoTON: 1 TON = 1,000,000,000 nanoTON
| TON | nanoTON |
|---|
| 0.1 | 100000000 |
| 0.5 |
500000000 |
| 1 | 1000000000 |
| 10 | 10000000000 |
Token decimals: TON/NOT/DOGS/BUILD/AGNT/PX/CBBTC = 9 decimals. USDT/XAUT0 = 6 decimals.
Usage examples
Check wallet and tokens
CODEBLOCK0
Send TON to .ton domain
CODEBLOCK1
Place a DEX order
CODEBLOCK2
Autonomous transfer (no approval)
CODEBLOCK3
Important
- - Safe mode (default): You request transfers, the wallet owner approves on their phone
- Autonomous mode: Agent wallet — agent signs directly, no approval. Only use when user explicitly asks
- Requests expire in 5 minutes if not approved
- Always use
lookup.resolve_name when the user gives a .ton domain - Token persists in
~/.tongateway/token across restarts
Security
See SECURITY.md for full security model details.
Links
- - Website: https://tongateway.ai
- API docs: https://api.tongateway.ai/docs
- MCP package: https://www.npmjs.com/package/@tongateway/mcp
- GitHub: https://github.com/tongateway/mcp
Agent Gateway
Agent Gateway 为您提供16个与TON区块链交互的工具。可查询余额、查看代币/NFT、发送转账、解析.ton域名、下达DEX订单以及部署自主代理钱包。
MCP包: @tongateway/mcp(通过 npx -y @tongateway/mcp 安装)
身份验证
如果遇到未配置令牌错误,请先进行身份验证:
- 1. 调用 auth.request — 您将获得一次性链接
- 请用户打开链接并连接钱包
- 使用authId调用 auth.get_token — 您将获得令牌
- 所有其他工具即可使用。令牌在重启后持续有效。
工具
钱包
| 工具 | 参数 | 描述 |
|---|
| wallet.info | — | 钱包地址、TON余额、账户状态 |
| wallet.jettons |
— | 所有代币余额(USDT、NOT、DOGS等) |
| wallet.transactions | limit?(数字) | 近期交易历史 |
| wallet.nfts | — | 钱包拥有的NFT |
转账(安全模式——需钱包批准)
| 工具 | 参数 | 描述 |
|---|
| transfer.request | to、amountNano、payload?、stateInit? | 将TON转账加入队列等待所有者批准 |
| transfer.status |
id | 检查状态:待处理、已确认、已拒绝、已过期 |
| transfer.pending | — | 列出所有待处理的转账请求 |
查询
| 工具 | 参数 | 描述 |
|---|
| lookup.resolve_name | domain | 将.ton域名解析为地址。当用户提供.ton名称时,务必在转账前使用 |
| lookup.price |
currencies? | TON的美元/欧元等价格 |
DEX(open4dev订单簿)
| 工具 | 参数 | 描述 |
|---|
| dex.create_order | fromToken、toToken、amount、price | 下达限价单。价格为人可读格式(例如20 = 1 USDT = 20 AGNT) |
| dex.pairs |
— | 列出可用交易对 |
代理钱包(自主模式——无需批准)
| 工具 | 参数 | 描述 |
|---|
| agentwallet.deploy | — | 部署专用钱包合约。警告:代理可在无需批准的情况下使用资金 |
| agentwallet.transfer |
walletAddress、to、amountNano | 直接从代理钱包发送TON |
| agent_wallet.info | walletAddress? | 余额、序列号、状态。省略地址可列出所有钱包 |
身份验证
| 工具 | 参数 | 描述 |
|---|
| auth.request | label? | 生成一次性身份验证链接 |
| auth.get_token |
authId | 用户连接钱包后获取令牌 |
金额转换
金额单位为nanoTON:1 TON = 1,000,000,000 nanoTON
| TON | nanoTON |
|---|
| 0.1 | 100000000 |
| 0.5 |
500000000 |
| 1 | 1000000000 |
| 10 | 10000000000 |
代币小数位数: TON/NOT/DOGS/BUILD/AGNT/PX/CBBTC = 9位小数。USDT/XAUT0 = 6位小数。
使用示例
查询钱包和代币
wallet.info()
→ 地址:0:9d43...0c02,余额:823.18 TON,状态:活跃
wallet.jettons()
→ USDT:107.79,NOT:3,186,370.60,BUILD:45,277.57
向.ton域名发送TON
lookup.resolve_name({ domain: alice.ton })
→ alice.ton → 0:83df...31a8
transfer.request({ to: 0:83df...31a8, amountNano: 500000000 })
→ 转账请求已创建。请在钱包应用中批准。
下达DEX订单
dex.create_order({ fromToken: NOT, toToken: TON, amount: 10000, price: 0.000289 })
→ 订单已在open4dev DEX下达。请在钱包应用中批准。
自主转账(无需批准)
agent_wallet.deploy()
→ 代理钱包已部署在EQCT1...
agent_wallet.transfer({ walletAddress: EQCT1..., to: 0:abc..., amountNano: 500000000 })
→ 转账已执行。无需批准。
重要说明
- - 安全模式(默认): 您请求转账,钱包所有者在手机上批准
- 自主模式: 代理钱包——代理直接签名,无需批准。仅在用户明确要求时使用
- 请求5分钟内未批准将过期
- 当用户提供.ton域名时,务必使用 lookup.resolve_name
- 令牌在重启后持续保存在 ~/.tongateway/token 中
安全性
完整安全模型详情请参阅 SECURITY.md。
链接
- - 官网:https://tongateway.ai
- API文档:https://api.tongateway.ai/docs
- MCP包:https://www.npmjs.com/package/@tongateway/mcp
- GitHub:https://github.com/tongateway/mcp