Skip to main content
Glama

api_haystack_get_swap_quote

Get optimized swap quotes across Algorand DEXes and LST protocols to preview best-price routes before executing trades.

Instructions

Get an optimized swap quote from Haystack Router — a DEX aggregator that finds the best swap route across multiple Algorand DEXes (Tinyman V2, Pact, Folks) and LST protocols (tALGO, xALGO). Returns the best-price quote with route details, USD values, and price impact. Use this to preview a swap before executing. 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)
typeNoQuote type: fixed-input (specify input amount, default) or fixed-output (specify desired output amount)fixed-input
addressNoUser Algorand address (optional, needed for auto opt-in detection)
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)
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's a read-only preview operation (not execution), mentions the DEX aggregator functionality, specifies base units for amounts, and describes the return content. It could improve by mentioning rate limits or error conditions.

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?

Perfectly concise and well-structured: three sentences that each earn their place (purpose, return details, usage guidance). No wasted words, and key information is front-loaded.

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?

For a read-only quote tool with 9 parameters and no output schema, the description provides good context about what the tool does and when to use it. It could be more complete by briefly mentioning the return format or potential limitations, but it's largely adequate given the tool's complexity.

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 parameters thoroughly. The description adds some context about base units and the preview purpose, but doesn't provide additional parameter semantics beyond what's in the schema. Baseline 3 is appropriate when 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 ('Get an optimized swap quote') and resources ('from Haystack Router'), and distinguishes it from siblings by specifying it's for previewing swaps before execution, unlike execution tools like api_haystack_execute_swap.

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 states when to use this tool ('Use this to preview a swap before executing'), providing clear context and distinguishing it from execution alternatives. It also mentions the tool's role in the swap 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/GoPlausible/algorand-mcp'

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