Skip to main content
Glama

Quote a trade

quote_trade
Read-only

What a buy or a sell of a Souvenir coin gives now, as the coin's page quotes it: { out, minOut, feeLamports, partial, venue }. out and minOut are the coin's raw units for a buy, lamports for a sell; minOut is the least you get at slippageBps. feeLamports is the trading fee (null on a pump.fun coin, where pump.fun takes it); partial, a buy larger than the curve has left (spent and refund say how much goes in). A coin paired with $SOUVENIR (get_coin's pair) trades in SOL the same way: one transaction swaps through $SOUVENIR, and keepsSouv, a little $SOUVENIR, stays in your wallet. pay: 'souvenir' trades it in $SOUVENIR you hold instead: the amount of a buy, and out and minOut of a sell, are then raw $SOUVENIR (6 decimals). Trading a coin, in order: (1) quote_trade to see what you would get; (2) build_trade with your wallet's address; (3) sign the transaction it answers with your wallet; (4) send_transaction, or send it yourself through any Solana RPC. No sign-in: your wallet's signature is the approval, and Souvenir never needs its private key. The same fees and limits as the coin's page on souvenir.finance. An agent helping a person, which can't sign with their wallet, uses request_trade instead and gives them the link to approve it with their own wallet.

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>",
      "side": "<side>",
      "amount": "<amount>"
    },
    "name": "quote_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
payNoWhat a coin paired with $SOUVENIR is paid in (a sell: what it receives): sol, the default, or souvenir. Any other coin takes sol only.
mintYesThe coin's mint address (base58).
sideYesbuy: spend SOL for the coin. sell: the coin for SOL. With pay souvenir, $SOUVENIR in place of SOL.
amountYesWhat you give, in whole units, as a string: lamports for a buy (1 SOL is 1000000000), the coin's raw units for a sell (Souvenir's and pump.fun's coins have 6 decimals: 1 coin is 1000000). With pay souvenir, a buy's is raw $SOUVENIR (6 decimals).
slippageBpsNoThe most the price may move against you before the trade refuses, in basis points (300 is 3%, the site's default).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"What you give, in whole units, as a string: lamports for a buy (1 SOL is 1000000000), the coin's raw units for a sell (Souvenir's and pump.fun's coins have 6 decimals: 1 coin is 1000000)."New value: +"What you give, in whole units, as a string: lamports for a buy (1 SOL is 1000000000), the coin's raw units for a sell (Souvenir's and pump.fun's coins have 6 decimals: 1 coin is 1000000). With pay souvenir, a buy's is raw $SOUVENIR (6 decimals)."
    • addedInput schema / properties / pay
      Added value: +{
      +  "description": "What a coin paired with $SOUVENIR is paid in (a sell: what it receives): sol, the default, or souvenir. Any other coin takes sol only.",
      +  "enum": [
      +    "sol",
      +    "souvenir"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / side / description
      Previous value: -"buy: spend SOL for the coin. sell: the coin for SOL."New value: +"buy: spend SOL for the coin. sell: the coin for SOL. With pay souvenir, $SOUVENIR in place of SOL."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description goes well beyond them, disclosing partial-fill behavior with spent/refund, that feeLamports is null on pump.fun coins, that $SOUVENIR-paired trades route through $SOUVENIR leaving keepsSouv in the wallet, and that no private key or sign-in is involved. That is exactly the operational context annotations cannot carry.

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-loads the return shape before the mechanics and every sentence carries information, but the block is long and the four-step trading workflow partly belongs to the build_trade/send_transaction definitions. The dense run-on parentheticals make it slower to scan than it needs to be.

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 takes on the job of documenting the return object field by field, and it does so, including the mode-dependent units and the partial/spent/refund relationship. Nothing an agent needs in order to call this correctly or interpret the result appears to be 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?

Schema coverage is already 100%, so the baseline is 3, but the description adds meaning the schema doesn't: how amount units shift per side and per pay mode, that minOut is the floor at slippageBps, and that sells under pay: 'souvenir' return raw 6-decimal $SOUVENIR. Some unit explanation duplicates the schema, which keeps it below a 5.

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 ('quote a buy or a sell ... as the coin's page quotes it') and immediately enumerates the returned fields {out, minOut, feeLamports, partial, venue}, which separates it from build_trade and send_transaction. An agent can tell this is a read-only pricing preview 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?

Gives an explicit ordered workflow: (1) quote_trade, (2) build_trade with the wallet address, (3) sign, (4) send_transaction. It also names the alternative for the case this tool doesn't fit — an agent that cannot sign with the user's wallet should use request_trade instead — and states no sign-in is required.

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