Skip to main content
Glama

swap

Execute a token swap on Base via 0x DEX Aggregator. AI-ENHANCED: Accepts natural language like 'swap 10 USDC for VIRTUAL'. THREE MODES: (1) PRIVY MODE (RECOMMENDED): Provide owner_wallet - uses your secure Privy custodial wallet (create one first with create_wallet tool). (2) PRIVATE KEY MODE: Provide privateKey - server signs with your key (less secure). (3) BRIDGE MODE: Provide takerAddress only - returns a URL where you sign with browser wallet. Cost: 0.10 USDC

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestNoNatural language swap request (e.g., 'swap 10 USDC for VIRTUAL', 'buy 100 DEGEN with USDC'). AI will extract the parameters automatically.
buyTokenNoToken symbol (USDC, WETH, VIRTUAL, DEGEN, cbBTC, DAI, AERO, BRETT) OR token address (0x...)
sellTokenNoToken symbol (USDC, WETH, VIRTUAL, DEGEN, cbBTC, DAI, AERO, BRETT) OR token address (0x...)
privateKeyNoLEGACY: Private key (0x... hex) to sign and broadcast transactions server-side. Consider using owner_wallet with Privy instead for better security.
sellAmountNoAmount to sell. Use human-readable (e.g., '1.5' for 1.5 tokens) or atomic units (e.g., '1000000' for 1 USDC). Human-readable is auto-detected.
slippageBpsNoSlippage in basis points (e.g., '50' = 0.50%). Takes precedence over slippagePercentage.
owner_walletNoRECOMMENDED: Your wallet address (0x...) that owns a Privy custodial wallet. The swap will be executed securely through your Privy wallet. Create one first using the create_wallet tool.
takerAddressNoUser's wallet address (0x...). When provided WITHOUT owner_wallet or privateKey, returns a secure web bridge URL where user can sign transactions with their browser wallet.
slippagePercentageNoSlippage tolerance in percent (e.g., '0.5' for 0.5%). Default: 0.50.5

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

The description discloses the cost (0.10 USDC), security differences between modes, and that bridge mode returns a URL. However, it does not disclose the return format for private key/Privy modes (e.g., transaction hash) nor potential side effects like token approval or failure behavior. With no annotations, the description has a high burden but remains incomplete.

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 well-structured and efficient, using sections for the three modes and clearly stating the cost. It front-loads the main purpose and avoids excessive repetition of schema details. While it is somewhat long, every sentence adds value and the formatting aids readability.

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?

For a tool with 9 parameters, no output schema, and no annotations, the description covers modes, cost, and wallet prerequisites. However, it lacks information about return values, error handling, and does not mention slippage defaults (though those are in the schema). It also omits the need for wallet funds, leaving gaps for an agent to fully understand the tool's behavior.

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?

The input schema has 100% coverage with each parameter having a description. The description reinforces which parameter maps to which mode, but this is already present in the schema descriptions. It does not introduce significant new parameter-specific semantics beyond the schema, so it meets but does not exceed the baseline.

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 clearly states 'Execute a token swap on Base via 0x DEX Aggregator,' specifying the verb, resource, and context. It further differentiates itself by detailing three distinct operational modes, which distinguishes it from any potential sibling tools.

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?

The description provides explicit guidance on which mode to use: Privy mode is recommended, private key mode is noted as less secure, and bridge mode is for browser sign-in. It also references create_wallet as a prerequisite. It stops short of explicitly stating when not to use the tool or naming alternative tools.

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