@tongateway/mcp 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -411,19 +411,19 @@ server.tool('get_ton_price', 'Get the current TON price in USD, EUR, or other cu
411
411
  return { content: [{ type: 'text', text: `Error: ${e.message}` }], isError: true };
412
412
  }
413
413
  });
414
- server.tool('create_dex_order', 'Place a limit order on the open4dev DEX order book. Provide the token pair (e.g. NOT→TON), amount, and price. The order is created as a safe transfer the user approves it in their wallet. Use get_ton_price or get_jetton_balances to determine current rates before swapping.', {
414
+ server.tool('create_dex_order', 'Place a limit order on the open4dev DEX order book. Provide the token pair, amount in smallest units, and price in human-readable format (e.g. price=20 means "1 fromToken = 20 toToken"). The API handles all decimal conversions and slippage automatically. The order requires wallet approval.', {
415
415
  fromToken: z.string().describe('Token to sell, e.g. "NOT", "TON", "USDT"'),
416
- toToken: z.string().describe('Token to buy, e.g. "TON", "NOT"'),
417
- amount: z.string().describe('Amount to sell in smallest unit (nanoTON for TON, or raw jetton amount based on decimals)'),
418
- priceRateNano: z.string().describe('Price rate in nanoTON per unit'),
419
- }, async ({ fromToken, toToken, amount, priceRateNano }) => {
416
+ toToken: z.string().describe('Token to buy, e.g. "TON", "NOT", "AGNT"'),
417
+ amount: z.string().describe('Amount to sell in smallest unit. TON/NOT/DOGS/BUILD/AGNT use 9 decimals (1 TON = 10^9). USDT/XAUT0 use 6 decimals (1 USDT = 10^6).'),
418
+ price: z.number().describe('Human-readable price: how many toToken per 1 fromToken. E.g. price=20 means "1 USDT = 20 AGNT". price=0.05 means "1 AGNT = 0.05 USDT".'),
419
+ }, async ({ fromToken, toToken, amount, price }) => {
420
420
  if (!TOKEN) {
421
421
  return { content: [{ type: 'text', text: 'No token configured. Use request_auth first.' }], isError: true };
422
422
  }
423
423
  try {
424
424
  const result = await apiCall('/v1/dex/order', {
425
425
  method: 'POST',
426
- body: JSON.stringify({ fromToken, toToken, amount, priceRateNano }),
426
+ body: JSON.stringify({ fromToken, toToken, amount, price }),
427
427
  });
428
428
  return {
429
429
  content: [{
@@ -433,8 +433,8 @@ server.tool('create_dex_order', 'Place a limit order on the open4dev DEX order b
433
433
  ``,
434
434
  `${fromToken} → ${toToken}`,
435
435
  `Amount: ${amount}`,
436
- `Price Rate: ${priceRateNano} nanoTON`,
437
- `Pool: ${result.swap?.pool || 'unknown'}`,
436
+ `Price: ${price} ${toToken} per ${fromToken}`,
437
+ `Slippage: ${result.swap?.slippage ?? 4}% (includes fees)`,
438
438
  `Request ID: ${result.id}`,
439
439
  ``,
440
440
  `Approve the order in your wallet app.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tongateway/mcp",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "MCP server for Agent Gateway — lets AI agents request TON blockchain transfers",
5
5
  "license": "MIT",
6
6
  "repository": {