Skip to main content
Glama

Execute a swap

execute_swap
Destructive

Execute a swap that get_swap_quote already priced. ⚠️ THIS SPENDS REAL MONEY. It submits a real transaction from the user's wallet using real funds and cannot be undone. Confirm the exact amount, token and network with the user in plain language, and get their explicit go-ahead, BEFORE calling this. Only ever pass a quote_id returned by get_swap_quote in this same conversation, after showing the user that quote's numbers and receiving an unambiguous yes. Never call this to 'check' anything. If it answers that the quote expired, get a fresh quote — never re-send the old quote_id.

AMOUNTS: read the _ui fields (whole tokens) when talking to the user — the un-suffixed output_amount / minimum_output_amount / filled_*_amount are in the token's SMALLEST unit. A null amount is unknown, never zero: fill_pending: true means the trade was submitted but its fill is not booked yet — say so, and read the received amount from get_swap_status rather than guessing it.

Input Schema

NameRequiredDescriptionDefault
quote_idYes`quote_id` from a recent `get_swap_quote` response.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive + non-idempotent, but the description adds material context beyond them: real funds, irreversibility, only the user could authorize, quote-expiry failure mode, and the `fill_pending: true` state meaning the fill is not yet booked. That last detail is behavioral knowledge an agent could not infer from schema or annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose sentence comes first, the money warning is immediately second and visually marked, and the AMOUNTS paragraph is separated by a label. Length is justified for a destructive financial action; no filler sentences.

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?

Output schema exists, yet the description still adds the critical unit caveat (`_ui` = whole tokens vs smallest-unit raw fields) and the null-vs-zero distinction with a pointer to `get_swap_status`. Nothing an agent needs to call or read the result correctly is missing.

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?

With one parameter at 100% schema coverage the baseline is 3; the description earns above that by tightening the constraint to a `quote_id` returned by `get_swap_quote` in this same conversation, ruling out stale or cross-session IDs.

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+resource and draws a hard line against `get_swap_quote`, clarifying that this one spends funds while the sibling only prices. It does not, however, distinguish itself from `quick_buy`/`quick_sell`, which are also fund-spending execution tools an agent could plausibly reach for instead.

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?

Gives explicit preconditions (quote_id from `get_swap_quote` in the same conversation, user confirmation of amount/token/network in plain language), an explicit prohibition ("Never call this to 'check' anything"), and the recovery path when a quote expires. Few definitions route an agent this completely.

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