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 wallet or API key required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyYesToken you buy
sellYesToken you sell
takerYesYour wallet (signs the swap)
amountYesAmount you sell
slippageNoSlippage in bps (optional, default 100)

Output Schema

TableJSON 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. Added

TDQS

A4.1/5.0
Behavior4/5

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

The annotations already declare readOnly, openWorld, idempotent, and non-destructive, and the description adds substantial behavioral context: returns a transaction for the caller's wallet to sign, includes an approval step if needed, never holds funds, and runs honeypot/sellability checks. The only blemish is referencing a force=1 flag that is not present in the input schema.

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?

The description is dense and front-loaded, leading with the core capability and then covering return contents, safety behavior, required inputs, and pricing. It could be tightened with bullet points or by removing slight redundancy between the first clauses, but no sentence is pure filler.

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 5-parameter tool with full schema coverage and an output schema, the description covers inputs, return payload, safety checks, and auth/cost model well. The main gaps are the undocumented force=1 parameter and no mention of the optional slippage parameter or likely failure modes.

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 useful token-naming guidance ('Name tokens as ETH, USDC, WETH, cbBTC, AERO… or a 0x address') and reinforces that taker is the signing wallet. The optional slippage parameter receives no extra explanation, but the schema already documents its default.

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 opens with a specific verb-resource pair ('Swap on Base... ready-to-sign transaction') and names the routing network, DEX venues, and return payload. It clearly differentiates itself from siblings like near_swap by being Base-specific and from quote-only tools by returning a signable transaction.

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?

It gives strong context — Base network, no API key needed, x402 pricing, required inputs — but never explicitly says when to use this tool over alternatives such as swap_route, near_swap, or pre_trade_gate. Usage is implied rather than stated with exclusions.

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