Skip to main content
Glama

ChainGuard Web3 Security & DeFi MCP

build_evm_dust_to_usdt_sweep

Read-onlyIdempotent

Build unsigned non-custodial SAME-CHAIN swap calldata (exact-amount ERC-20 approve + audited KyberSwap/OpenOcean router swap) converting an ERC-20 token into USDT or USDC on the SAME EVM network (base, arbitrum, optimism, polygon, ethereum, bsc, linea, or avalanche). Read-only calldata builder: does not sign or broadcast transactions (unlimited free calls; embeds a 1.00% on-chain integrator fee). Returns JSON with approve_tx, swap_tx, eip5792_calls, estimated_out_usd, and provider. Use this tool when input token and output stablecoin remain on the SAME chain; use build_cross_chain_consolidation when bridging between two DIFFERENT chains.

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": {
      "token_in": "<token_in>",
      "amount_in_raw": "<amount_in_raw>",
      "sender": "<sender>"
    },
    "name": "build_evm_dust_to_usdt_sweep"
  }
}

Input Schema

NameRequiredDescriptionDefault
senderYes42-character hexadecimal EVM wallet address (`0x...`) that owns `token_in` and will receive the output USDT/USDC.
networkNoSingle EVM chain on which both `token_in` and the output `target_stable` reside. Defaults to `base`.base
token_inYes42-character hexadecimal ERC-20 contract address (`0x...`) of the token to swap on `network`.
amount_in_rawYesExact input amount in atomic base units (wei/smallest integer unit as a decimal string, e.g. `1000000000000000000` for 1.0 18-decimal token).
target_stableNoDestination stablecoin symbol on the same network (`USDT` or `USDC`). Defaults to `USDT`.USDT

Output Schema

NameRequiredDescriptionDefault
networkYes
swap_txYes
providerYes
estimated_out_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / amount_in_raw / description
      Added value: +"Exact input amount in atomic base units (wei/smallest integer unit as a decimal string, e.g. `1000000000000000000` for 1.0 18-decimal token)."
    • addedInput schema / properties / network / description
      Added value: +"Single EVM chain on which both `token_in` and the output `target_stable` reside. Defaults to `base`."
    • addedInput schema / properties / network / enum
      Added value: +[
      +  "base",
      +  "arbitrum",
      +  "optimism",
      +  "polygon",
      +  "ethereum",
      +  "bsc",
      +  "linea",
      +  "avalanche"
      +]
    • addedInput schema / properties / sender / description
      Added value: +"42-character hexadecimal EVM wallet address (`0x...`) that owns `token_in` and will receive the output USDT/USDC."
    • addedInput schema / properties / target_stable / description
      Added value: +"Destination stablecoin symbol on the same network (`USDT` or `USDC`). Defaults to `USDT`."
    • addedInput schema / properties / target_stable / enum
      Added value: +[
      +  "USDT",
      +  "USDC"
      +]
    • addedInput schema / properties / token_in / description
      Added value: +"42-character hexadecimal ERC-20 contract address (`0x...`) of the token to swap on `network`."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "estimated_out_usd": {
      +      "type": "number"
      +    },
      +    "network": {
      +      "type": "string"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "swap_tx": {
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "network",
      +    "provider",
      +    "swap_tx"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: no signing or broadcast, unlimited free calls, a 1.00% on-chain integrator fee, and the approve+swap call structure with an EIP-5792 calls array. The read-only framing is consistent with readOnlyHint=true and destructiveHint=false. It stops short of discussing router failure modes or approval edge cases, keeping it just under a 5.

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?

Front-loaded with the core action and constrained to one dense paragraph with no filler. Slightly over-specified by enumerating return fields (`approve_tx`, `swap_tx`, etc.) that an existing output schema already covers.

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

Completeness5/5

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

For a 5-parameter calldata builder with full schema documentation, annotations, and an output schema, nothing an agent needs to invoke it correctly is missing. Safety profile, chain scope, cost, and the routing decision are all covered.

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 coverage is 100% and each parameter already carries a detailed description including atomic-unit formatting and defaults, so the description adds little parameter-specific meaning. It reinforces the same-chain constraint for `network` but supplies no format or syntax detail beyond the schema.

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

Purpose5/5

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

States a specific verb and resource ('Build unsigned non-custodial SAME-CHAIN swap calldata'), names the exact mechanics (ERC-20 approve + KyberSwap/OpenOcean router swap), the supported networks, and the output asset. It is clearly distinguishable from the bridging sibling without opening either schema.

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

Usage Guidelines5/5

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

Explicitly gives the selection rule: use this when input token and output stablecoin are on the SAME chain, and use `build_cross_chain_consolidation` when bridging between two DIFFERENT chains. The alternative is named along with the condition that selects it.

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.