Skip to main content
Glama

execute_swap

Swap tokens on a DEX with slippage protection across EVM networks. Specify input and output tokens, amount, and minimum output to execute secure swaps.

Instructions

Execute a token swap on a DEX

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dexNoSpecific DEX to use
networkNoNetwork name (e.g. 'bsc', 'opbnb', 'ethereum', 'base', etc.) or chain ID. Supports others main popular networks. Defaults to BSC mainnet.bsc
tokenInYesAddress of the token to sell
amountInYesAmount of input token (in wei/smallest unit)
deadlineNoTransaction deadline in seconds from now (default: 1200 = 20 minutes)
tokenOutYesAddress of the token to buy
privateKeyYesPrivate key in hex format (with or without 0x prefix). SECURITY: This is used only for address derivation and is not stored. The private key will not be logged or displayed in chat history.
minAmountOutYesMinimum amount of output token to receive (slippage protection)
Behavior2/5

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

With no annotations, the description carries full responsibility for disclosing that this executes a financial transaction, spends funds, requires gas, and is irreversible. It only says 'Execute a token swap', which implies action but provides no explicit warning or operational details.

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

Conciseness2/5

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

The description is a single short sentence, but it adds almost no information beyond the tool name 'execute_swap'. It is under-specified rather than efficiently informative, so it does not earn its place.

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

Completeness1/5

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

For a tool with 8 parameters, 5 required, no output schema, and no annotations, the description is far too sparse. It omits critical context such as network scope, the need for quotes/slippage checks, gas requirements, and the irreversible nature of the transaction, making it inadequate for an agent to use safely.

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% with per-parameter descriptions, so the baseline is 3. The description adds no parameter-level semantics beyond what the schema already provides; it merely repeats the generic 'swap on DEX' context.

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?

The description 'Execute a token swap on a DEX' clearly identifies the action (execute) and resource (token swap on DEX), which distinguishes it from non-swap tools. However, it does not differentiate from chain-specific swap tools like solana_execute_swap or mention the EVM/network context, so it lacks full sibling differentiation.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use this tool versus alternatives such as get_swap_quote or get_best_route, nor does it mention prerequisites like token approval or quoting. There is no context for selecting this over other swap/bridge execution tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nirholas/universal-crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server