Skip to main content
Glama
Haiku-Trading

Haiku DeFi MCP

Official

haiku_execute

Execute a DeFi swap or bridge by broadcasting the transaction or returning an unsigned tx for external signing. Use after haiku_get_quote to complete the trade with signatures and approvals.

Instructions

Execute a quote. Call haiku_get_quote first, then choose a path: • Path A — Self-contained (WALLET_PRIVATE_KEY set): pass quoteId, sourceChainId, permit2SigningPayload + bridgeSigningPayload (if present in the quote), and approvals. Haiku signs Permit2/bridge internally, sends any approvals on-chain, and broadcasts. Returns tx hash. • Path B — External wallet (no WALLET_PRIVATE_KEY): broadcast: false is required. First broadcast any approvals from the quote via your wallet MCP (each is a {to, data} transaction). Then call haiku_prepare_signatures if signatures are needed → sign via wallet MCP → call haiku_execute with quoteId, sourceChainId, the signatures, and broadcast: false. Returns { transaction: { to, data, value, chainId } } — broadcast transaction via your wallet MCP. Always pass sourceChainId from the quote response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quoteIdYesQuote ID from haiku_get_quote
permit2SigningPayloadNopermit2SigningPayload from haiku_get_quote (for self-contained signing)
bridgeSigningPayloadNobridgeSigningPayload from haiku_get_quote (cross-chain only, for self-contained signing)
permit2SignatureNoPre-signed Permit2 signature (external wallet mode)
userSignatureNoPre-signed bridge intent signature (external wallet mode)
approvalsNoapprovals from haiku_get_quote. Self-contained mode only: haiku broadcasts these on-chain before the swap. In external wallet mode (broadcast: false), do not pass these — broadcast each approval {to, data} via your wallet MCP before calling haiku_execute.
sourceChainIdNoChain ID of the source token (from haiku_get_quote). Recommended — if omitted, the server will attempt to recover it from the signing payloads or session cache, but passing it explicitly is safer.
broadcastNoIf true (default), broadcasts tx. If false, returns unsigned tx.
Behavior5/5

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

No annotations provided, so description carries full burden. It fully discloses the tool's behavior: two distinct execution modes, signing internal vs external, broadcasting behavior (broadcast: true/false), and the transaction output format (tx hash vs { to, data, value, chainId }). No contradictions with annotations since none exist.

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 well-structured with bullet points for two clear paths, front-loading the main purpose. Every sentence adds value with no redundancy. Length is appropriate for the complexity.

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

Completeness5/5

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

Given 8 parameters with 100% schema coverage, no output schema, and high complexity (two modes, nested objects), the description fully covers usage flow, parameter dependencies, and return format for both paths. No gaps identified.

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 significant value beyond schema by explaining when each parameter is needed (e.g., approvals in self-contained vs external mode, permit2SigningPayload vs permit2Signature based on path). The 'broadcast' parameter's effect is clarified. Minor deduction for not detailing the nested objects' structure (e.g., approval {to, data}) beyond what schema provides.

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 'Execute a quote' and distinguishes two paths (self-contained vs external wallet), which differentiates it from sibling tools like haiku_get_quote or haiku_prepare_signatures. The verb 'execute' plus resource 'quote' is specific and unambiguous.

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 step-by-step instructions for both Path A and Path B, including when to call haiku_get_quote first, when to use haiku_prepare_signatures, and when to broadcast approvals via wallet MCP. It clearly states alternatives and when not to use certain parameters.

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