Skip to main content
Glama

Swap tokens on Base (your user sends it)

swap_tokens

Swap USDC, EURC or WETH (say ETH; you get WETH, wrapped ETH) on Base through Uniswap, from your user's own wallet. Only when your user turned swaps on (dashboard: Your limits → Swaps) and within their limits (default $50 per swap, $100 a day). It doesn't swap by itself: it quotes the best Uniswap pool, sets the minimum your user gets (their slippage, default 0.5%), approves exactly the amount when needed (never unlimited), has presign-guard check every transaction with a verdict bound to exactly that transaction (red is refused), and returns an approve_url where your user sends it from their own wallet (also sent to their phone). The price holds about 2 minutes; the page can refresh it. Then call swap_status.

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

Input Schema

NameRequiredDescriptionDefault
amountYesHow much of from_token, like "40"
reasonNoWhy, in a few words: shown to your user
to_tokenYesWhat your user gets (ETH means WETH)
from_tokenYesWhat your user pays with

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it explains that the tool does not move funds itself, sets slippage-based minimums (default 0.5%), approves exactly the needed amount rather than unlimited, runs a presign-guard whose red verdict refuses the transaction, and returns an approve_url sent to the user's phone. The quote's ~2-minute validity and refresh behavior are also disclosed. This is consistent with readOnlyHint=false and destructiveHint=false, since nothing is sent without the user acting.

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 what the swap does and the gating conditions, and nearly every clause carries actionable information. The middle sentence is long and enumerates five behaviors in one breath, which slightly hurts scanability but does not waste words.

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?

With no output schema, the description does cover the key return (approve_url, also pushed to the user's phone) and the next step. Minor gaps remain around error/refusal outcomes and what other response fields look like, but nothing essential for a correct call is missing.

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 coverage is 100%, so all four parameters, including the ETH-means-WETH enum note, are already documented in the schema. The description echoes the ETH→WETH mapping but adds no new syntax, format, or unit detail for amount or reason, so it sits at 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?

States a specific verb and resource with scope: swaps USDC/EURC/WETH on Base through Uniswap from the user's own wallet. The ETH→WETH aliasing is spelled out, and the closing 'Then call swap_status' clearly separates this tool from its sibling.

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?

Explicit preconditions: only when the user enabled swaps (dashboard: Your limits → Swaps) and within the default $50/swap, $100/day limits. It also names the required follow-up (swap_status), leaving little 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.