Skip to main content
Glama

base_swap

Read-onlyIdempotent

Swap on Base at the best price — a ready-to-sign transaction — An executable swap on Base, routed by 0x across Uniswap, Aerodrome, Balancer, Curve and more. Returns the transaction for your own wallet to sign, plus the approval step if needed, minimum out, route and fees. We never hold funds. Name tokens as ETH, USDC, WETH, cbBTC, AERO… or a 0x address; buying an unknown token runs a sellability check first and refuses a honeypot unless force=1. Required inputs: sell, buy, amount, taker. Priced $0.01 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No API key required.

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": {
      "sell": "<sell>",
      "buy": "<buy>",
      "amount": "<amount>",
      "taker": "<taker>"
    },
    "name": "base_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyYesToken you buy
sellYesToken you sell
forceNoPass 1 to quote a token that failed the sellability check anyway
takerYesYour wallet (signs the swap)
amountYesAmount you sell
slippageNoSlippage in bps (optional, default 100)

Output Schema

NameRequiredDescriptionDefault
dataNoThe result payload. Shape is service-specific; every field is documented in the tool description.
serviceNoThe service id that answered.
checkedAtNoISO-8601 timestamp of when the underlying reads were taken.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / force
      Added value: +{
      +  "description": "Pass 1 to quote a token that failed the sellability check anyway",
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the agent learns it gets an unsigned transaction plus approval step, min-out, route and fee, that the server never holds funds, that unknown tokens trigger a sellability check before quoting, and the payment model (x402 $0.01/call, prepaid x-credit-token header, 1 free call/day, no API key). readOnlyHint=true is consistent with a quote-builder that returns a transaction rather than broadcasting it.

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?

Front-loaded with the core claim and then layered with routing, return contents, safety and pricing. The opening is slightly redundant, restating the same idea three ways ('Swap on Base at the best price', 'ready-to-sign transaction', 'An executable swap on Base'), but no sentence is otherwise wasted.

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?

Covers everything an agent needs for a paid, multi-parameter swap builder: required inputs, token naming flexibility, safety fallback, custody stance, and the billing/auth model. With an output schema present, the brief mention of returned transaction/approval/min-out/route/fees is sufficient rather than mandatory.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning: tokens may be given as symbols (ETH, USDC, WETH, cbBTC, AERO) or a 0x address, taker is the wallet that signs, and force=1 overrides a failed sellability check. Slippage units (bps) are left to the schema.

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?

States a specific verb and resource ('executable swap on Base') plus the mechanism ('routed by 0x across Uniswap, Aerodrome, Balancer, Curve') and the deliverable ('ready-to-sign transaction'). An agent can distinguish this from siblings like base_swap_validity, swap_route, or near_swap_quote without opening the schema.

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?

Makes the use condition clear: this is the executable path that returns a signable transaction, with required inputs named (sell, buy, amount, taker) and the honeypot escape hatch documented (force=1). It does not explicitly exclude or route against near_swap/swap_route, so the alternative-selection guidance is implied rather than stated.

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