Skip to main content
Glama

execute_swap

Executes a token swap on Uniswap V3 after simulation. Pass the simulation ID to finalize the trade securely.

Instructions

Executes a token swap via Uniswap V3. You MUST call simulate_swap first and pass the returned simulation_id here. Returns a transaction_id to track the status with get_transaction_status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_tokenYesToken to sell. Must match simulate_swap call.
to_tokenYesToken to buy. Must match simulate_swap call.
amount_inYesAmount to sell. Must match simulate_swap call.
chain_idNoChain ID. Default: 1 (Ethereum mainnet).
slippage_toleranceNoMax slippage tolerance in percentage. Example: 0.5 = 0.5%.
simulation_idYesThe simulation_id returned by simulate_swap. Required for safety.
Behavior3/5

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

Discloses key behaviors: execution, prerequisite simulation, and async tracking. However, lacks details on gas costs, failure modes, and state-changing nature, which is important given no annotations.

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

Conciseness5/5

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

Extremely concise two sentences, front-loaded with action, no redundant information.

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?

Covers the essential workflow (simulate, execute, track) well. Lacks minor details like token format or return value specifics, but schema covers parameters sufficiently.

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 has 100% coverage with descriptions. Description adds no extra parameter details, but reinforces consistency with simulate_swap. Baseline 3 is appropriate.

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?

Clearly states it executes a token swap via Uniswap V3. Differentiates from sibling tools like simulate_swap (simulation) and swap_curve (different protocol).

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 requires calling simulate_swap first and using the returned simulation_id. Also explains output can be tracked with get_transaction_status, providing a clear workflow.

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/felippeyann/agentfi'

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