Skip to main content
Glama

prepare_swap

Prepare unsigned, reviewed swap calldata for local signing on Base Aerodrome Slipstream, Base PancakeSwap V3, the Base agent swap guard, or a Solana Loopscale vault deposit. Use it when the user wants an executable transaction bound to a reviewed pool and policy. Do not use it to sign, submit or route arbitrary calldata, and do not skip the matching safety gate. Returns the unsigned transaction envelope (to/value/calldata), reviewed profile, quote and, where supported, a signed decision. Deprecated alias: prefer trade_guard with op "prepare_swap". Removed on 2027-01-06.

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": {
      "venue": "<venue>",
      "amount_in": "<amount_in>"
    },
    "name": "prepare_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
vaultNo
venueYesReviewed execution venue
policyNo
walletNo
amount_inYesExact input amount as a decimal string
directionNo
recipientNo
asset_mintNo
input_mintNoSolana base58 mint sold; required for venue=solana_jupiter
profile_idNo
loan_symbolNo
output_mintNoSolana base58 mint bought; required for venue=solana_jupiter
min_lp_amountNo
max_slippage_bpsNo
principal_amountNo
collateral_symbolNo
collateral_value_usdNo
deadline_unix_secondsNo
source_decision_price_usdNo
destination_decision_price_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / input_mint
      Added value: +{
      +  "description": "Solana base58 mint sold; required for venue=solana_jupiter",
      +  "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / output_mint
      Added value: +{
      +  "description": "Solana base58 mint bought; required for venue=solana_jupiter",
      +  "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
      +  "type": "string"
      +}
    • changedInput schema / properties / venue / enum
      Previous value: -[
      -  "base_aerodrome_slipstream",
      -  "base_pancakeswap_v3",
      -  "base_agent_swap",
      -  "solana_loopscale_vault"
      -]New value: +[
      +  "base_aerodrome_slipstream",
      +  "base_pancakeswap_v3",
      +  "bnb_pancakeswap_v3",
      +  "base_agent_swap",
      +  "solana_loopscale_vault",
      +  "solana_jupiter"
      +]
  2. Added

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses that output is unsigned, that signing/submission is out of scope, that a safety gate must be run, and that the tool is deprecated with a removal date. It omits auth/permission requirements and rate limits, keeping it short of a 5.

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 purpose, then usage constraints, then return shape, then deprecation. Dense but nearly every clause carries information; the venue enumeration is long but necessary for routing.

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 20-parameter, no-annotation, no-output-schema tool, the description covers the return envelope and safety-gate requirement but leaves most parameters and venue-specific requirements (e.g. which fields apply to solana_jupiter vs loopscale) unexplained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 20% across 20 parameters, and the description adds almost no per-parameter meaning beyond naming venues and mentioning a 'reviewed profile' and 'policy'. Fields like direction, min_lp_amount, principal_amount, collateral_value_usd, and the decision-price fields are left entirely to the schema.

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 ('Prepare unsigned, reviewed swap calldata') and enumerates the exact venues it covers, so an agent can distinguish it from quote or safety-check siblings without opening the schema.

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?

Explicitly gives the when ('user wants an executable transaction bound to a reviewed pool and policy'), the when-not ('do not use it to sign, submit or route arbitrary calldata'), and names the preferred alternative (trade_guard with op "prepare_swap").

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.