Skip to main content
Glama

Sato Hub: Build Onchain & Crypto Agents

Quote a swap, check it against a policy, and get an unsigned transaction

onchain_agent_swap

USE WHEN an agent is about to swap and wants the venue chosen, the fee disclosed, and the trade CHECKED before anything is signed. Two modes: recommend returns the choice, the fee sentence and the verdicts and NEVER a transaction; build-tx returns an UNSIGNED transaction, and only when the gate allowed it and a simulation did not revert. build-tx WRITES a receipt row. NOT FOR a plain quote with no policy gate (use onchain_agent_route_swap instead), a token launch (use onchain_agent_route_launch), or a liquidity pool (use onchain_agent_route_lp).

NON-CUSTODIAL: this tool NEVER signs, holds, moves or broadcasts funds, and it never asks for a key. What comes back is an unsigned object the caller signs or discards. The response signature proves Sato Hub produced those bytes; it is not a claim that anyone authorised a transfer.

WHAT IS CHECKED, and under what: four targets — token_in, token_out, the venue endpoint, and the recipient — each with its own verdict, the rule id that produced it and the reason. Then the caller's policy (caps per trade and per period, allowed chains, tokens, venues, recipients, slippage and deadline). Manage policies at https://satohub.ai/api/swap/policies; with no stored policy the default applies.

UNKNOWN REFUSES BY DEFAULT. A target we could not read, or a simulation that could not run, WITHHOLDS the transaction unless the policy says otherwise — and the response says which lane could not be read. "We did not check" and "we checked and it is fine" never look alike. A refusal is an ANSWER: it is not an error, and retrying it unchanged will refuse again.

A COUNTERPARTY WITH NO PASSPORT IS no_record: the ordinary case, not a finding against the address. wallet_verified proves control of a key, never anything about the product behind it. There is no list of trusted counterparties here.

THE FEE: disclosed verbatim in disclosure, per venue, before anything is signed. A trade that is never signed pays nothing. sato_fee_side ("in" or "out") and sato_fee_token say which leg the fee is taken on and in what token: on KyberSwap, Jupiter and 0x, when exactly one side is a stablecoin or the chain's native asset (in Sato Hub's tables) the fee is taken on THAT side; otherwise on the leg disclosure names. They are part of the signed answer. price_impact is the venue's own reading (reported_bps, or usd_value_gap_bps from its USD valuations, which include fees); null is unknown.

PINNING A VENUE: pass venue to quote one venue only; if it cannot answer, the reply names it and says why, and no other venue is tried.

CROSS-CHAIN: recipient is the destination address (deBridge builds for it; Solana needs it); recipient_owner: "self" declares it yours (RCPT5). Native coin = 0x000…0.

RECEIPT: a build-tx response is recorded and receipt_url points at the public record of what was checked, under which policy, at what instant. A receipt is not a claim the trade filled.

RETURNS (json): { mode, lane, route_id, pinned_venue (only when venue was set), venue, chain, chain_out, recipient, bridge ({ protocol, order_id, fix_fee_wei, take_amount, allowed_taker_dst }; null off a cross-chain deBridge order), token_in, token_out, amount_in, amount_out, sato_fee_bps, sato_fee_recipient, sato_fee_side, sato_fee_token, sato_fee_tier, referral, price_impact, disclosure, chosen_by, alternatives, unavailable_venues, preflight, gate: { verdict, refusals, policy_id, policy_version }, gate_result: { allowed, verdicts, verdicts_digest, counterparty, policy }, simulation, tx | null, withheld: { reason, rule } | null, receipt_url, non_custodial, checked_at, caveat, meta: { signature } }. When no adapter answered: { unavailable, tried, checked_at, caveat, code? } (code "fee_side_unavailable" when neither side is a stablecoin or the native coin: swap through USDC or the chain's own native coin).

Example: { chain_in: "Base", token_in: "USDC", token_out: "WETH", amount_in: "1000000", mode: "recommend" }

Input Schema

NameRequiredDescriptionDefault
modeNo`recommend` (default) never returns a transaction, whatever the gate said. `build-tx` returns an unsigned one, and only when the gate allowed it AND the simulation did not revert.
takerNoThe address that would sign. Some venues only return a transaction when it is given; nothing is ever signed here.
venueNoPin ONE venue. Only it is quoted; if it cannot answer, is not offered on the chain or is refused, the reply names it and says why, and no other venue is tried. Omit and the chooser ranks every venue that quotes.
chain_inYesSource chain as the directory writes it. The agent bots swap on Base, BNB Chain, Arbitrum, Polygon and Solana; a short spelling ('bnb', 'bsc', 'matic', 'arbitrum one') is read as the same chain, and other chains the venues quote work by their display name, e.g. 'Ethereum'.
deadlineNoUnix seconds the quote should stay good until. Omit for the venue's own default.
referrerNoOptional referral: a referral name (like sunny-otter) or a payout address (a Base 0x address or a Solana address) that earns 30% of the Sato fee on this swap, paid weekly in USDC once Sato Hub has read the fee onchain. It needs the taker (the address that will sign) to be named too, and it applies to same-chain swaps only: without a taker the answer carries referral null. The trade and the fee address do not change. A bad address or a name Sato Hub has no record of is refused as referrer_invalid; one of Sato Hub's own fee addresses is ignored, and so is a retired name (referral null). The answer's `referral` echoes what was recorded (null when none).
token_inYesInput token: a contract address (or Solana mint), or a symbol for the well-known stablecoins.
amount_inYesSell amount in the INPUT token's base units (1000000 = 1 USDC at 6 decimals). A string, because a uint256 does not survive a JSON number.
chain_outNoDestination chain. Omit, or repeat chain_in, for a same-chain swap. A different value is the cross-chain lane, and the two lanes are never compared with each other.
recipientNoWhere the output goes. Omit to send to the taker. A recipient we hold no record of is `no_record` — an absence of evidence, and on its own never a refusal.
token_outYesOutput token: a contract address (or Solana mint), or a symbol.
slippage_bpsNoSlippage tolerance in basis points, passed through to the venue. A policy may cap it, and then the refusal states the cap and the value.
usd_notionalNoUSD notional of amount_in, when YOU already hold a price. Omitted is unknown, never zero — a USD cap simply does not bite without it.
recipient_ownerNoThe caller declares `recipient` is ITS OWN address on `chain_out`. Sato Hub does not check that. Read only on a cross-chain `build-tx` (rule RCPT5: the look-alike and mark checks still run first); ignored on a same-chain swap and in `recommend` mode.
response_formatNoText format; structuredContent is JSON either way.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / recipient_owner
      Added value: +{
      +  "description": "The caller declares `recipient` is ITS OWN address on `chain_out`. Sato Hub does not check that. Read only on a cross-chain `build-tx` (rule RCPT5: the look-alike and mark checks still run first); ignored on a same-chain swap and in `recommend` mode.",
      +  "enum": [
      +    "self"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / chain_in / description
      Previous value: -"Source chain as the directory writes it, e.g. 'Base', 'Ethereum', 'Solana'."New value: +"Source chain as the directory writes it. The agent bots swap on Base, BNB Chain, Arbitrum, Polygon and Solana; a short spelling ('bnb', 'bsc', 'matic', 'arbitrum one') is read as the same chain, and other chains the venues quote work by their display name, e.g. 'Ethereum'."
  3. Changed1 schema field changed
    • changedInput schema / properties / referrer / description
      Previous value: -"Optional referral: a payout address (a Base 0x address or a Solana address) that earns 30% of the Sato fee on this swap, paid weekly in USDC once Sato Hub has read the fee onchain. It needs the taker (the address that will sign) to be named too, and it applies to same-chain swaps only: without a taker the answer carries referral null. The trade and the fee address do not change. A bad address is refused as referrer_invalid; one of Sato Hub's own fee addresses is ignored. The answer's `referral` echoes what was recorded (null when none)."New value: +"Optional referral: a referral name (like sunny-otter) or a payout address (a Base 0x address or a Solana address) that earns 30% of the Sato fee on this swap, paid weekly in USDC once Sato Hub has read the fee onchain. It needs the taker (the address that will sign) to be named too, and it applies to same-chain swaps only: without a taker the answer carries referral null. The trade and the fee address do not change. A bad address or a name Sato Hub has no record of is refused as referrer_invalid; one of Sato Hub's own fee addresses is ignored, and so is a retired name (referral null). The answer's `referral` echoes what was recorded (null when none)."
  4. Changed1 schema field changed
    • addedInput schema / properties / referrer
      Added value: +{
      +  "description": "Optional referral: a payout address (a Base 0x address or a Solana address) that earns 30% of the Sato fee on this swap, paid weekly in USDC once Sato Hub has read the fee onchain. It needs the taker (the address that will sign) to be named too, and it applies to same-chain swaps only: without a taker the answer carries referral null. The trade and the fee address do not change. A bad address is refused as referrer_invalid; one of Sato Hub's own fee addresses is ignored. The answer's `referral` echoes what was recorded (null when none).",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • addedInput schema / properties / venue
      Added value: +{
      +  "description": "Pin ONE venue. Only it is quoted; if it cannot answer, is not offered on the chain or is refused, the reply names it and says why, and no other venue is tried. Omit and the chooser ranks every venue that quotes.",
      +  "enum": [
      +    "0x-protocol",
      +    "1inch",
      +    "jupiter-aggregator",
      +    "odos",
      +    "kyberswap",
      +    "relay",
      +    "debridge",
      +    "lifi",
      +    "cow"
      +  ],
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  7. Changed1 schema field changed
    • changedInput schema / properties / response_format / description
      Previous value: -"Output format: 'markdown' (default) or 'json'."New value: +"Text format; structuredContent is JSON either way."
  8. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give the generic safety flags (readOnly=false, destructive=false, openWorld=true, idempotent=false), while the description supplies the real behavioral context: non-custodial, never signs or broadcasts, build-tx writes a receipt row, unknown targets refuse by default, refusals are not errors and are not retryable, and fee disclosure happens before signing. This is far beyond repeating structured fields and is consistent with the annotations.

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?

It is long, but it is front-loaded with USE WHEN / NOT FOR / modes and uses capitalized headers to make it scannable rather than a wall of prose. Some material (the RETURNS block) is verbose enough to feel like smuggling in an output schema, though that block does real work given no output schema exists.

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?

For a 15-parameter, mutating, open-world tool with no output schema, the description covers the full lifecycle: inputs, gate/verdict behavior, refusal semantics, fee disclosure, cross-chain lane, receipt side effect, and a documented return shape including the error path (`unavailable`/`fee_side_unavailable`). An agent has everything needed to call it and interpret the result.

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 baseline is 3, and most parameter meaning (venue pinning, recipient semantics, recipient_owner/RCPT5, referral rules, slippage caps) is already in the schema text. The description's added value at the parameter level is marginal — the fee-side/`sato_fee_token` logic and the native-coin 0x000…0 convention are useful, but they describe output fields more than input parameters.

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 title and opening sentence state a specific verb+resource chain (quote a swap, check against policy, produce an unsigned tx) and the two modes are named and distinguished. It also explicitly separates itself from onchain_agent_route_swap, route_launch and route_lp, so an agent can pick it out of a large sibling list.

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?

A 'USE WHEN' clause gives the triggering condition, a 'NOT FOR' clause names three alternatives with the exact condition that selects each, and the mode semantics (recommend vs build-tx) state when a transaction will and will not appear. Nothing about selection is left to inference.

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.