Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Swap Price Impact

workflow.run_swap_price_impact
Read-only

Live price-impact quote for a Solana token swap: routed through Jupiter (the same aggregator real swaps use) across every pool it knows about, not a single-pool estimate. Works in both directions: side "sell" (default) sells a token into USDC or SOL, side "buy" spends USDC or SOL to buy the token. Use when user asks "how much slippage will I eat swapping X tokens?", "what will I actually get if I sell N tokens?" or "what do I get buying this token with 500 SOL?". Returns: side, outputAmount (quote asset when selling, tokens when buying), priceImpactPct, effectivePrice (quote asset per token in both directions), marketPriceUsd, liquidityUsd, routable (false + error if the size can't be routed at all).

Input Schema

NameRequiredDescriptionDefault
mintYesSolana mint address of the token being sold or bought (base58)
sideNosell: sell the token for outputAsset (default). buy: spend outputAsset to buy the token.
amountYesAmount to swap, in human units (not raw base units): tokens when side is sell, units of outputAsset to spend when side is buy
outputAssetNoThe quote asset: received when selling, paid with when buying. Default USDC.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"Amount of the token to swap, in human units (not raw base units)"New value: +"Amount to swap, in human units (not raw base units): tokens when side is sell, units of outputAsset to spend when side is buy"
    • changedInput schema / properties / mint / description
      Previous value: -"Solana mint address of the token being sold (base58)"New value: +"Solana mint address of the token being sold or bought (base58)"
    • changedInput schema / properties / outputAsset / description
      Previous value: -"Asset to receive. Default USDC."New value: +"The quote asset: received when selling, paid with when buying. Default USDC."
    • addedInput schema / properties / side
      Added value: +{
      +  "description": "sell: sell the token for outputAsset (default). buy: spend outputAsset to buy the token.",
      +  "enum": [
      +    "sell",
      +    "buy"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, non-destructive, open-world), and the description goes further by naming the data source (Jupiter, all known pools), enumerating the returned fields, and disclosing the failure mode ('routable: false + error if the size can't be routed at all'). It also clarifies units and directionality of outputAmount/effectivePrice, which annotations cannot express.

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?

Single dense paragraph that leads with the core mechanism, then directions, then trigger examples, then returns — a logical front-loaded order with no filler sentences. It is on the long side, but every clause carries information an agent needs.

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?

There is no output schema, so the description must carry return-value semantics — and it does, listing side, outputAmount, priceImpactPct, effectivePrice, marketPriceUsd, liquidityUsd, and routable with their direction-dependent meanings. Combined with full schema coverage, nothing material is missing for correct invocation or interpretation.

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% with enums documented for side and outputAsset, so the schema already does the heavy lifting. The description reinforces direction semantics ('sell (default)' vs 'buy spends USDC or SOL') and shows a worked amount example, but adds little beyond what the schema states.

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 ('live price-impact quote for a Solana token swap') and qualifies the mechanism ('routed through Jupiter ... not a single-pool estimate'), which separates it from single-venue siblings like run_orderbook_impact. An agent can identify the tool 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete trigger phrasings ('how much slippage will I eat swapping X tokens?', 'what do I get buying this token with 500 SOL?') and explains the two directions plus defaults, which is strong usage context. It stops short of explicitly stating when to prefer a different sibling (e.g. run_pre_trade_check or run_token_risk_check) over this quote.

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.