Skip to main content
Glama

Prepare trade

prepare_trade
Read-only

Build an UNSIGNED buy or sell transaction (base64, legacy format) for the given wallet. This does not execute the trade or move funds. To execute it, sign with that wallet and broadcast to Solana before lastValidBlockHeight. Never send a private key to this tool or any other.

Input Schema

NameRequiredDescriptionDefault
mintYesToken mint address (base58)
sideYesTrade direction
amountYesPositive integer as a string. buy: SOL in lamports (1 SOL = 1000000000). sell: raw token units (6 decimals, 1 token = 1000000)
slippageBpsNoSlippage tolerance in basis points. Default 300 (3%)
walletPublicKeyYesPublic address of the wallet that will sign and pay (base58)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds important behavioral detail beyond that: the output is an unsigned base64 legacy-format transaction, no funds move, execution requires signing and broadcasting before lastValidBlockHeight, and private keys must never be sent. This is exactly the kind of operational context an agent needs before invoking a transaction-preparation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three tight sentences and front-loads the core action, then the non-execution caveat, then the follow-up signing and broadcast requirement. Every sentence contributes useful information with no filler.

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 explain the return value, and it does: an unsigned base64 legacy-format transaction plus the lastValidBlockHeight broadcast deadline. Together with the security warning and the read-only annotations, an agent has enough context to select and invoke the tool correctly.

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 description coverage is 100%, so the schema already documents mint, side, amount, slippageBps, and walletPublicKey including enum and amount-unit details. The description does not add parameter-specific syntax or format guidance beyond the schema, so the baseline score of 3 is appropriate.

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?

The description states a specific verb and resource: 'Build an UNSIGNED buy or sell transaction (base64, legacy format) for the given wallet.' It also explicitly sets scope by saying the tool does not execute the trade or move funds, which distinguishes it from any execution or broadcast path and from the sibling tools get_quote, get_wallet, and list_markets.

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?

It clearly says what to do next (sign with the wallet and broadcast before lastValidBlockHeight) and warns never to send a private key, giving practical usage context. It does not explicitly mention when to use this versus calling get_quote first, or any exclusions, so it falls short of a full when/when-not/alternatives statement.

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