Skip to main content
Glama

Polymarket, Kalshi, Hyperliquid Funding Arbitrage & DEX Swap MCP

Build Ready-to-Sign Multi-DEX Smart Swap Calldata (Base/Arb/ETH/Polygon)

build_smart_dex_swap_calldata
Read-onlyIdempotent

Assembles non-custodial unsigned EVM transaction calldata (to, data, value, minOutAmount) across OpenOcean v4 + KyberSwap + LI.FI for any token symbol or 0x contract address. Saves 65%-71% vs wallet/bot swap fees.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "src": "<src>",
      "dest": "<dest>",
      "amount": "<amount>"
    },
    "name": "build_smart_dex_swap_calldata"
  }
}

Input Schema

NameRequiredDescriptionDefault
srcYesInput token symbol ('ETH', 'USDC') or 0x ERC-20 address
destYesOutput token symbol ('USDC', 'ETH', 'cbBTC') or any 0x ERC-20 token address
modeNo'standard' (0.25% fee) or 'bot' (0.35% sniper execution)
amountYesHuman-readable input token amount (e.g. 1.0)
senderNoTrader EVM wallet address (0x...) that will sign locally
chainIdNoEVM chain ID ('8453' Base, '42161' Arbitrum, '137' Polygon, '10' Optimism, '1' Ethereum, '56' BSC)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnlyHint=true, destructiveHint=false, idempotent, openWorld), and the description adds real context beyond them: the output is non-custodial and unsigned (nothing is broadcast or held), which aggregators are routed, and a fee/savings claim. It still omits failure behavior (no route found, unsupported token) and any rate-limit or prerequisite notes. The savings figure reads as marketing rather than operational disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the artifact and its fields, plus the routing sources. The trailing 'Saves 65%-71% vs wallet/bot swap fees' is promotional padding that does not help invocation, but it costs little space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description usefully enumerates the returned fields (to, data, value, minOutAmount), which is the key thing an agent needs to chain into a signing step. Gaps remain around slippage/minOut computation and what is returned when no route exists across the three aggregators, so it is not fully complete for a 6-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, including the mode fee split and chainId enumeration, so the schema carries the parameter burden. The description only echoes that src/dest accept 'any token symbol or 0x contract address', which the schema already states. Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Assembles non-custodial unsigned EVM transaction calldata (to, data, value, minOutAmount)' and names the routing sources (OpenOcean v4, KyberSwap, LI.FI). An agent knows exactly what artifact comes back. It does not explicitly distinguish itself from the sibling quote_low_fee_dex_swap, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: 'ready-to-sign' calldata implies you call this when you need a signable transaction rather than a price quote, and the 'mode' fee choice (standard vs bot) hints at two workflows. There is no explicit when-to-use, no when-not-to-use, and no named alternative such as the quoting sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.