Skip to main content
Glama

ref_finance_execute_swap

Swap tokens on Ref Finance using a specific pool or optimizing for liquidity and rates. Specify input/output tokens, amounts, and swap type for efficient transactions.

Instructions

Execute a swap on Ref Finance based on two tokens and a pool id. Prioritize pools with higher liquidity and better rates for the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesThe account id of the user doing the swap
amountYesThe amount of the input tokens to swap
networkIdNomainnet
swapTypeNoThe type of estimate to get. Defaults to the ref finance smart router to find the best price over all available pools
tokenInYes
tokenOutYes
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions prioritizing liquidity and rates, which hints at optimization behavior, but fails to disclose critical traits: it doesn't state this is a write/mutation operation (likely requiring authentication), doesn't mention transaction costs, rate limits, or error handling, and doesn't describe what happens on execution (e.g., token transfer confirmation).

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?

The description is two concise sentences with zero waste. The first sentence states the core purpose, and the second adds a key behavioral guideline. It's front-loaded and appropriately sized for the tool's complexity.

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

Completeness2/5

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

Given the tool's complexity (6 parameters, nested objects, no output schema, and no annotations), the description is inadequate. It lacks details on authentication needs, transaction behavior, error cases, and output format. For a financial swap tool with significant parameters and no structured safety hints, more context is required to ensure safe and correct usage.

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 description coverage is 50%, so the description must compensate but only partially does. It mentions 'two tokens and a pool id', aligning with 'tokenIn', 'tokenOut', and 'swapType' parameters, but doesn't explain the meaning or interaction of other parameters like 'accountId', 'amount', or 'networkId'. The description adds minimal value beyond what the schema provides for covered parameters.

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 clearly states the action ('Execute a swap') and target ('on Ref Finance'), specifying it involves 'two tokens and a pool id'. It distinguishes from sibling tools like 'ref_finance_get_swap_estimate' by focusing on execution rather than estimation. However, it doesn't explicitly differentiate from other transaction tools like 'tokens_send_ft' beyond the Ref Finance context.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'Prioritize pools with higher liquidity and better rates', suggesting this tool should be used for optimal swaps. It doesn't explicitly state when to use this vs. alternatives like 'ref_finance_get_swap_estimate' (for estimation) or 'tokens_send_ft' (for direct transfers), nor does it provide exclusions or prerequisites.

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

Related 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/nearai/near-mcp'

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