Skip to main content
Glama

Hookr

Build a swap

hookr_build_swap
Read-onlyIdempotent

Builds an exact-input swap through Hookr's router as an unsigned call for the wallet to sign and send, with its least output from the quote and your slippage, a 20-minute deadline and the gas to send it with, after checking the wallet's balance and simulating the swap from the wallet. Its status is ok (send the call), needs_approval (send the approval, then build again), or refused or unknown (no calls, with the reason). Every quote states priceImpactBps, null when it did not read; at or past 15% or on a token that is not the official one for its symbol the answer is refused, and an unread impact is unknown, never ok. accept names what to pass to build it anyway.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "poolId": "<poolId>",
      "side": "<side>",
      "amount": "<amount>",
      "wallet": "<wallet>"
    },
    "name": "hookr_build_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesbuy pays the pool's quote currency (ETH, HOOKR, …) for the token; sell pays the token for the quote currency.
amountYesHow much the trade pays in, in the paying currency's own units as a decimal string, e.g. "0.05".
poolIdYesThe pool's 32-byte Uniswap v4 PoolId, 0x and 64 hex characters.
walletYesThe wallet that signs and pays.
recipientNoWhere the output goes. Defaults to the wallet.
acceptTokenNoThe address of a look-alike token you mean to trade, one that is not the official token for its symbol.
slippageBpsNoHow far below the quote the output may land, in basis points (default 50).
acceptImpactBpsNoThe most price impact you accept, in basis points, as a second tap on the swap box. Needed at or past 1500; an impact that did not read takes 10000.

Output Schema

NameRequiredDescriptionDefault
callsYesUnsigned calls, in the order to send them.
payerNoThe wallet that signs and pays.
quoteNo
acceptNoWhat to pass to build this trade anyway.
reasonNoWhy the answer is not ok, in words an agent can act on.
statusYesok, needs_approval, refused or unknown. refused and unknown carry no calls.
deadlineNo
agentGateNo
recipientNoWhere the swap's output goes, as the calldata carries it.
minimumOutNo
recipientIsPayerNoFalse when the output goes to a wallet other than the one that signs; the swap's label says so too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Beyond the annotations, it discloses the 20-minute deadline, that the output is the quote's least output adjusted by slippage, that the wallet balance is checked and the swap simulated, and that gas is included. The status enumeration plus the rule that an unread price impact is 'unknown, never ok' are precisely the behavioral facts an agent cannot get from the schema.

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

Conciseness3/5

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

Purpose and status contract are front-loaded, so nothing critical is buried. But the first sentence is a single overstuffed clause chain ('with its least output from the quote and your slippage, a 20-minute deadline and the gas to send it with') that is harder to parse than it needs to be.

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 build-then-sign tool with an output schema present, the description covers the return contract (statuses), the safety gates (impact threshold, token identity), and the escape hatches (accept*). It stops short of stating chain support or how a stale quote interacts with the 20-minute deadline, which are the remaining ambiguities.

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 coverage is 100%, so the schema already defines every parameter, including the accept overrides and slippage bounds. The description adds only a light link — that 'accept' is what lets a refused build proceed, and that acceptImpactBps is needed at or past 1500 — which is useful but marginal over the already-documented fields.

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 opening clause names a specific verb (builds), an exact-input swap resource, and the concrete output form: an unsigned call for the wallet to sign and send. That distinguishes it in substance from a quote/check tool like hookr_check_trade, though no sibling is named explicitly.

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?

It gives clear next-step routing per status: ok means send the call, needs_approval means send the approval then build again, refused/unknown means no calls. The refusal condition (impact at or past 15%, wrong token for symbol) tells the agent when the tool will not proceed, though it never names the quote tool that should supply priceImpactBps first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources