Skip to main content
Glama

Swap Tokens via Fibrous

swap_tokens
Destructive

Swap ERC-20 and native tokens on Base, HyperEVM, and Monad via Fibrous routing with automatic approvals and wrap/unwrap; use simulate=true for a no-broadcast preview.

Instructions

Swap tokens using Fibrous aggregator for optimal routing. Handles ERC-20 approvals and wrap/unwrap automatically. Supported chains: Base, HyperEVM, Monad. Set simulate=true for a no-broadcast preview; a gas estimate is returned where it can be calculated safely.

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": {
      "amount": "<amount>",
      "from_token": "<from_token>",
      "to_token": "<to_token>"
    },
    "name": "swap_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoTarget blockchain networkbase
amountYesAmount to swap (e.g. '0.1', '100')
simulateNoSet true for a no-broadcast preview; gas estimates may be unavailable
slippageNoSlippage tolerance percentage (0.01-50, default: 0.5)
to_tokenYesDestination token symbol
from_tokenYesSource token symbol (e.g. 'ETH', 'USDC', 'MON')

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.10.2
    • changedInput schema / properties / chain / enum
      Previous value: -[
      -  "base",
      -  "citrea",
      -  "hyperevm",
      -  "monad"
      -]New value: +[
      +  "base",
      +  "hyperevm",
      +  "monad"
      +]
    • changedInput schema / properties / slippage / description
      Previous value: -"Slippage tolerance percentage (default: 0.5)"New value: +"Slippage tolerance percentage (0.01-50, default: 0.5)"
    • addedInput schema / properties / slippage / maximum
      Added value: +50
    • addedInput schema / properties / slippage / minimum
      Added value: +0.01
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and non-idempotent, so the safety bar is partly met. The description adds material context beyond them: automatic ERC-20 approvals and wrap/unwrap side effects, plus the caveat that gas estimates may be unavailable in simulation. It still does not explain why the operation is destructive (irreversibility, fund movement) or what the caller receives on success.

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?

Four short sentences, front-loaded with purpose, then chains, simulation and gas caveat — no filler. Minor redundancy: the supported-chain list duplicates the chain enum and the simulate sentence largely restates the schema description, but the framing is efficient.

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

Completeness3/5

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

There is no output schema, so the description is the only place a return shape could be described, and it only mentions a gas estimate. For a destructive, fund-moving swap it omits what a successful call returns (transaction hash, approval txs) and any confirmation or failure behavior, leaving a meaningful gap for a high-stakes tool.

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 every parameter including slippage bounds, amount format and chain enum is already documented in structured fields. The description only reinforces simulate=true and notes the gas-estimate consequence; it adds no new meaning about amount precision, token symbol resolution, or slippage trade-offs.

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?

States a specific verb and resource ('Swap tokens using Fibrous aggregator for optimal routing') and scopes it to three named chains. It does not explicitly distinguish itself from siblings like get_quote (quote-only) or send_tokens (transfer), so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives one concrete usage cue: set simulate=true for a no-broadcast preview, which usefully implies a dry-run-before-execute workflow. It offers no guidance on when to use this versus get_quote first or send_tokens instead, and no prerequisites (auth, balance, connected wallet) are mentioned despite siblings like connect_wallet and get_auth_status existing.

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