Skip to main content
Glama

swap_curve

Swap assets on a Curve StableSwap pool with low slippage. Specify pool address and token indices for stablecoin conversions.

Instructions

Swaps between two assets on a Curve StableSwap pool. Ideal for stablecoin-to-stablecoin conversions (USDC↔USDT↔DAI) with minimal slippage. The caller must supply the pool address and the indices of the input/output tokens within that pool. Assumes fromToken has already been approved to the pool; simulation will fail clearly if approval is missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poolYesCurve pool contract address.
chain_idNoChain ID. Default: 1 (Ethereum mainnet).
amount_inYesAmount of input token in human-readable units.
min_amount_outYesMinimum acceptable amount of output token (slippage protection).
to_token_indexYesIndex of the output token within the pool.
from_token_indexYesIndex (0, 1, 2, ...) of the input token within the pool.
to_token_addressYesERC-20 address of the output token.
from_token_addressYesERC-20 address of the input token.
Behavior3/5

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

No annotations provided, so description carries full burden. It mentions that approval is assumed and simulation fails if missing, but does not disclose other behaviors like potential slippage loss, fee structure, or return value. Adequate but not comprehensive.

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?

Three sentences covering purpose, ideal use, and requirements. No unnecessary words. Front-loaded with the core action.

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?

Given 8 parameters (7 required) and no output schema, the description covers pool, indices, approval assumption, and slippage protection. However, it does not explain the return value or mention what happens on success. Still fairly complete for the intended use.

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

Parameters4/5

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

Schema coverage is 100%, but description adds meaningful context: explains that indices refer to token positions in the pool and that fromToken must be approved. This connects parameters to real-world usage, adding value 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 the tool swaps between two assets on a Curve StableSwap pool, specifically for stablecoin conversions with minimal slippage. It distinguishes from siblings like execute_swap (generic) and simulate_swap (simulation) by specifying the protocol and use case.

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?

Provides practical guidance: caller must supply pool address and token indices, and fromToken must be approved. It implies ideal use case (stablecoin swaps) but does not explicitly compare with alternatives or state when not to use.

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