Skip to main content
Glama
Haiku-Trading

Haiku DeFi MCP

Official

haiku_get_quote

Get a quote for token swaps or portfolio rebalances, returning expected outputs, fees, gas estimates, and required approvals. Includes EIP-712 signing payloads for Permit2 or bridge signatures when needed.

Instructions

Get a quote for a token swap or portfolio rebalance. Returns expected outputs, fees, gas estimates, and any required approvals. When signatures are required (Permit2 or bridge), EIP-712 signing payloads are included in the response. Two execution paths after getting a quote: • Path A — Self-contained (WALLET_PRIVATE_KEY set): call haiku_execute with quoteId, sourceChainId, permit2SigningPayload + bridgeSigningPayload (if present in this response), and approvals. Haiku signs and broadcasts automatically — returns tx hash. • Path B — External wallet (wallet MCP, broadcast: false required): (1) broadcast any approvals {to, data} via wallet MCP first; (2) call haiku_prepare_signatures with quoteId if signatures are needed → sign via wallet MCP; (3) call haiku_execute with quoteId, sourceChainId, signatures, and broadcast: false → returns { transaction: { to, data, value, chainId } } → broadcast transaction via wallet MCP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPositionsYesMap of token IID to amount. IID format: "<chain-slug>:<token-address>". Supported chain slugs: arb=Arbitrum(42161), base=Base(8453), eth=Ethereum(1), poly=Polygon(137), opt=Optimism(10), bsc=BNB Chain(56), avax=Avalanche(43114), gnosis=Gnosis(100), sonic=Sonic(146), worldchain=World Chain(480), scroll=Scroll(534352), lisk=Lisk(1135), sei=Sei(1329), bera=Berachain(80094), bob=BOB(60808), hype=Hyperliquid(999), katana=Katana(747474), monad=Monad(143), plasma=Plasma(9745), uni=Unichain(130), ape=ApeChain(33139), megaeth=MegaETH(4326). Example: { "arb:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": "1.5" }
targetWeightsYesMap of output token IID to weight (sum to 1). Example: { "arb:0xaf88...": 0.5, "arb:0xFd08...": 0.5 }
slippageNoMax slippage as decimal (e.g., 0.003 for 0.3%). Default: 0.003
receiverNoReceiving wallet address. Required when WALLET_PRIVATE_KEY is not set — must be provided explicitly. When WALLET_PRIVATE_KEY is set, auto-derived from it if omitted.
Behavior4/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 transparently explains that the tool returns EIP-712 signing payloads when signatures are required and outlines the two execution paths. However, it does not disclose potential side effects, rate limits, or authorization requirements beyond the receiver field note.

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 well-structured with bullet points for the two execution paths, making it easy to parse. It is slightly verbose due to the detailed path explanations, but every sentence adds value and avoids repetition.

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 the tool's complexity (nested objects, multiple execution paths, no output schema), the description covers the key aspects: what the tool returns, how to proceed after getting a quote, and parameter details. However, it could be improved by mentioning that no output schema exists, so the agent must infer the response structure.

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 description coverage is 100%, so baseline is 3. The description adds value by explaining the IID format and providing examples for inputPositions and targetWeights, as well as clarifying the receiver parameter's behavior based on private key presence. However, it does not elaborate on slippage beyond its default value.

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 fetches a quote for token swaps or portfolio rebalances, listing expected outputs like fees, gas estimates, and required approvals. It also distinguishes this tool from siblings by detailing its role as the first step in a multi-tool execution flow.

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?

The description provides explicit guidance on when to use this tool (before execution) and details two distinct execution paths (Path A with private key, Path B with external wallet) including step-by-step instructions and sibling tool names like haiku_execute and haiku_prepare_signatures.

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/Haiku-Trading/haiku-mcp-server'

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