Skip to main content
Glama

execute_swap

After simulation, execute the token swap via Uniswap V3. Returns a transaction ID for status tracking.

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
chain_idNoChain ID. Default: 1 (Ethereum mainnet).
to_tokenYesToken to buy. Must match simulate_swap call.
amount_inYesAmount to sell. Must match simulate_swap call.
from_tokenYesToken to sell. Must match simulate_swap call.
simulation_idYesThe simulation_id returned by simulate_swap. Required for safety.
slippage_toleranceNoMax slippage tolerance in percentage. Example: 0.5 = 0.5%.
Behavior3/5

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

No annotations provided, so the description must cover behavioral aspects. It discloses the requirement of a simulation_id for safety and the return of a transaction_id, but lacks details on failure modes, gas implications, or cost aspects.

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?

Two concise sentences with front-loaded action and prerequisite. No wasted words.

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?

No output schema, so description explains return value and follow-up tool. Covers essential flow but could mention approval or wallet requirements for completeness.

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%, parameters already have descriptions. The description adds context about matching simulate_swap call and simulation_id requirement, but does not significantly enhance understanding 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?

The description clearly states it executes a token swap via Uniswap V3, which is specific and distinguishes it from sibling tools like swap_curve.

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

Usage Guidelines4/5

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

Explicitly mandates calling simulate_swap first and passing the simulation_id, and mentions returning a transaction_id for status tracking. Could clarify when not to use, but the prerequisite is well communicated.

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