Skip to main content
Glama

api_haystack_execute_swap

Execute optimized token swaps on Algorand by finding the best routes across multiple DEXes and LST protocols, then signing and submitting atomic transaction groups.

Instructions

Execute an optimized token swap via Haystack Router — gets the best route across multiple DEXes (Tinyman V2, Pact, Folks) and LST protocols, then signs and submits the atomic transaction group using the active wallet account. This is an all-in-one tool: quote → sign → submit → confirm. All amounts are in base units (e.g., 1000000 = 1 ALGO).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromASAIDYesInput asset ID (0 = ALGO, 31566704 = USDC, 312769 = USDt, etc.)
toASAIDYesOutput asset ID (0 = ALGO, 31566704 = USDC, 312769 = USDt, etc.)
amountYesAmount in base units (e.g., 1000000 = 1 ALGO with 6 decimals)
slippageNoSlippage tolerance percentage (e.g., 1 = 1%). Recommended: 0.5-1% stable pairs, 1-3% volatile, 3-5% low liquidity
typeNoQuote type: fixed-input (specify input, default) or fixed-output (specify desired output)fixed-input
noteNoOptional note to attach to the input transaction (plain text)
maxGroupSizeNoMaximum transactions in atomic group (default: 16)
maxDepthNoMaximum routing hops (default: 4)
networkNoAlgorand network to use (default: mainnet)
itemsPerPageNoNumber of items per page for paginated responses (default: 10)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it's an atomic transaction group that signs and submits using the active wallet account, and it confirms the swap. However, it lacks details on permissions needed, rate limits, error handling, or what 'confirm' entails (e.g., wait for blockchain confirmation).

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the core purpose and key details. Both sentences earn their place: the first defines the tool's scope and process, and the second clarifies amount units. There is no wasted text, though it could be slightly more structured for readability.

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

Completeness3/5

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

Given the tool's complexity (10 parameters, no output schema, no annotations), the description is moderately complete. It covers the high-level process and unit clarification but lacks details on output format, error cases, or confirmation specifics. For a tool that executes financial transactions, more behavioral context would be beneficial to fully guide an agent.

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 100%, so the schema already documents all 10 parameters thoroughly. The description adds minimal value beyond the schema, only reiterating that amounts are in base units and mentioning the all-in-one process, which doesn't provide additional parameter semantics. Baseline 3 is appropriate when the schema does the heavy lifting.

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's purpose with specific verbs ('execute an optimized token swap') and resources ('via Haystack Router across multiple DEXes and LST protocols'). It distinguishes itself from sibling tools like api_haystack_get_swap_quote by emphasizing the all-in-one nature: 'quote → sign → submit → confirm'.

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?

The description provides clear context for when to use this tool ('all-in-one tool: quote → sign → submit → confirm'), implying it should be used for complete swap execution rather than just quoting. However, it does not explicitly state when not to use it or name specific alternatives, though the sibling list includes quoting tools like api_haystack_get_swap_quote.

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/GoPlausible/algorand-mcp'

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