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. Edge cases: mint a valid Solana base58 address (32 to 48 characters); amount above zero; side sell (default) or buy; outputAsset USDC (default) or SOL. Quotes come live from Jupiter and are a moment in time; an unknown token or no route returns routable false with an error and no figures. Solana only. Not covered: EVM swaps, MEV and sandwiching, priority fees, a price that moves between the quote and your swap, and tokens Jupiter cannot route. 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).

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": {
      "mint": "<mint>",
      "amount": "<amount>"
    },
    "name": "workflow.run_swap_price_impact"
  }
}

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.8/5.0
Behavior5/5

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

Annotations already declare readOnly/openWorld/non-destructive, and the description adds substantive behavior on top: quotes are live and time-point-in-nature, unknown tokens or missing routes return routable=false with an error and no figures, and there is an explicit list of what the tool does not model. It also discloses the failure shape before invocation, which is exactly what an agent needs.

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?

The purpose is front-loaded and every sentence carries information, but there is measurable redundancy: the side/outputAsset defaults are stated twice (in the edge-case clause and again in the parameters-style clause), and the returns list repeats the outputAmount directionality already implied earlier. Trimming that duplication would tighten it without losing content.

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?

With no output schema, the description carries the return-value burden and does so explicitly (side, outputAmount, priceImpactPct, effectivePrice, marketPriceUsd, liquidityUsd, routable plus error). For a live external-data tool with four parameters and open-world reach, the scope, input constraints, failure modes, and return fields are all covered.

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 the baseline is 3, but the description adds real constraints beyond the schema: mint must be a valid base58 address of 32–48 characters, amount must be above zero, and the defaults for side and outputAsset are restated. It stops short of explaining the unit semantics of amount, which the schema already handles, so this is a modest lift over the baseline rather than a full one.

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?

"Live price-impact quote for a Solana token swap" names the specific verb and resource, and the description immediately scopes it as Jupiter-aggregated across all pools rather than a single-pool estimate. It also draws a hard boundary ("Solana only", "Not covered: EVM swaps") that separates it from generic siblings like run_orderbook_impact or run_price_consensus.

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 trigger phrasing is given in the user's own words ("how much slippage will I eat swapping X tokens?", "what will I actually get if I sell N tokens?"), and the "Not covered" list states the exclusions (EVM, MEV/sandwiching, priority fees, price movement, unroutable tokens). Both when-to-use and when-not are covered, which is the top of the scale.

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.