Skip to main content
Glama

Execute quoted swap (real money)

execute_swap
Destructive

Execute a quoted swap from the user's agent wallet. Real money. Only after the user approves the quote. Buys are checked against the app-set limits. ⚠️ SPENDS REAL MONEY from the user's agent wallet; cannot be undone. Get an explicit yes on the exact amount and token BEFORE calling. Only pass a quote_id from get_swap_quote in this conversation, after the user saw its numbers and said yes. Never call it to 'check' anything. An expired quote needs a fresh quote, never the old id. When fill_pending is true, call get_swap_status(quote_id=...). AMOUNTS: quote the _ui fields (whole tokens); un-suffixed amounts are the smallest unit. Null = unknown, never zero; fill_pending: true = fill not booked yet (get_swap_status). A full sell cancels every resting TP/SL on the token, all lots (cancelled_order_ids; cancel_failed_order_ids / cancel_pending_order_ids + cancel_note are retried); a partial sell or a buy leaves them (null).

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": {
      "quote_id": "<quote_id>"
    },
    "name": "execute_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelsNoOptional. Your chart levels as numbers; images are not accepted. Stored with the trade and shown back to you.
thesisNoOptional. Your own note on this trade, 2–4 lines: why this coin, why now, what breaks it. Stored with the trade and shown back to you; ≤500 chars.
quote_idYes`quote_id` from a recent `get_swap_quote` response.
confidenceNoOptional. How sure you are.
expected_holdNoOptional. How long you expect to hold.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • removedInput schema / $defs / TradeLevelsParam / properties / entry_price / title
      Removed value: -"Entry Price"
    • removedInput schema / $defs / TradeLevelsParam / properties / invalidation / title
      Removed value: -"Invalidation"
    • removedInput schema / $defs / TradeLevelsParam / properties / risk_reward / title
      Removed value: -"Risk Reward"
    • removedInput schema / $defs / TradeLevelsParam / properties / stop_price / title
      Removed value: -"Stop Price"
    • removedInput schema / $defs / TradeLevelsParam / properties / target_price / title
      Removed value: -"Target Price"
    • removedInput schema / $defs / TradeLevelsParam / properties / timeframe / title
      Removed value: -"Timeframe"
    • removedInput schema / $defs / TradeLevelsParam / title
      Removed value: -"TradeLevelsParam"
    • changedInput schema / properties / confidence / description
      Previous value: -"Optional. How sure you are: `low`, `medium` or `high`."New value: +"Optional. How sure you are."
    • removedInput schema / properties / confidence / title
      Removed value: -"Confidence"
    • changedInput schema / properties / expected_hold / description
      Previous value: -"Optional. How long you expect to hold: `minutes`, `hours`, `days` or `weeks`."New value: +"Optional. How long you expect to hold."
    • removedInput schema / properties / expected_hold / title
      Removed value: -"Expected Hold"
    • changedInput schema / properties / levels / description
      Previous value: -"Optional. Your chart levels as numbers: entry_price, stop_price, target_price (USD), timeframe (1m/5m/15m/1h/4h/1d), risk_reward, invalidation (one line, <=140 chars). Pass `levels` when you have them; images are not accepted. Stored with the trade and shown back to you."New value: +"Optional. Your chart levels as numbers; images are not accepted. Stored with the trade and shown back to you."
    • removedInput schema / properties / quote_id / title
      Removed value: -"Quote Id"
    • changedInput schema / properties / thesis / description
      Previous value: -"Optional. Your own note on this trade, 2–4 lines: why this coin, why now, who's in it, what breaks it. Stored with the trade and shown back to you; ≤500 chars."New value: +"Optional. Your own note on this trade, 2–4 lines: why this coin, why now, what breaks it. Stored with the trade and shown back to you; ≤500 chars."
    • removedInput schema / properties / thesis / title
      Removed value: -"Thesis"
    • removedInput schema / title
      Removed value: -"execute_swapArguments"
  2. Changed5 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "TradeLevelsParam": {
      +    "properties": {
      +      "entry_price": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Entry price in USD.",
      +        "title": "Entry Price"
      +      },
      +      "invalidation": {
      +        "anyOf": [
      +          {
      +            "maxLength": 140,
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "One line: what breaks the idea.",
      +        "title": "Invalidation"
      +      },
      +      "risk_reward": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Reward divided by risk, e.g. 3.0.",
      +        "title": "Risk Reward"
      +      },
      +      "stop_price": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Stop price in USD.",
      +        "title": "Stop Price"
      +      },
      +      "target_price": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Target price in USD.",
      +        "title": "Target Price"
      +      },
      +      "timeframe": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "1m",
      +              "5m",
      +              "15m",
      +              "1h",
      +              "4h",
      +              "1d"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Chart timeframe the levels come from.",
      +        "title": "Timeframe"
      +      }
      +    },
      +    "title": "TradeLevelsParam",
      +    "type": "object"
      +  }
      +}
    • addedInput schema / properties / confidence
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "low",
      +        "medium",
      +        "high"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional. How sure you are: `low`, `medium` or `high`.",
      +  "title": "Confidence"
      +}
    • addedInput schema / properties / expected_hold
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "minutes",
      +        "hours",
      +        "days",
      +        "weeks"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional. How long you expect to hold: `minutes`, `hours`, `days` or `weeks`.",
      +  "title": "Expected Hold"
      +}
    • addedInput schema / properties / levels
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/TradeLevelsParam"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional. Your chart levels as numbers: entry_price, stop_price, target_price (USD), timeframe (1m/5m/15m/1h/4h/1d), risk_reward, invalidation (one line, <=140 chars). Pass `levels` when you have them; images are not accepted. Stored with the trade and shown back to you."
      +}
    • addedInput schema / properties / thesis
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 500,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional. Your own note on this trade, 2–4 lines: why this coin, why now, who's in it, what breaks it. Stored with the trade and shown back to you; ≤500 chars.",
      +  "title": "Thesis"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructive/non-idempotent/open-world, yet the description still adds substantive behavior: spends real money with no undo, buys are checked against app-set limits, and a full sell cancels every resting TP/SL on the token while a partial sell or buy leaves them untouched. It also names the retry fields (`cancelled_order_ids`, `cancel_failed_order_ids`) and the `fill_pending` not-booked-yet state, none of which the annotations convey.

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 destructive warning and the approval gate, which is the right ordering for a real-money tool. It runs long and repeats 'real money' in several forms, but nearly every remaining sentence carries a distinct operational rule (expiry, `_ui` amounts, null semantics, cancel behavior).

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 the full lifecycle an agent needs: obtain quote, confirm with user, execute, then follow up with `get_swap_status` when `fill_pending` is true. An output schema exists, and the description still pre-explains the `_ui` vs smallest-unit amounts and the null-means-unknown convention so results are not misread.

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 baseline would be 3, but the description adds real constraints on `quote_id` beyond the schema's 'recent get_swap_quote response': it must originate in this conversation, post-approval, and must not be a stale expired id. The optional `levels`/`thesis`/`confidence`/`expected_hold` parameters are left entirely to the schema, which is acceptable given full coverage.

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 ('Execute a quoted swap from the user's agent wallet') and immediately pins the input to a quote from `get_swap_quote`, which separates it from the quoting sibling. The 'Real money' qualifier and the full-sell/cancel side effect make the action unmistakable versus read-only siblings like `get_swap_quote` or `get_swap_status`.

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 ('Only after the user approves the quote', 'explicit yes on the exact amount and token BEFORE calling'), an explicit prohibition ('Never call it to check anything'), and handles the edge case of an expired quote by routing to a fresh quote rather than reusing the old id. The 'this conversation' constraint on where the `quote_id` may come from is a genuine when/when-not rule.

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