Skip to main content
Glama
TradeRouter

trade-router-mcp

Official

build_swap

Construct an unsigned Solana swap transaction for buying or selling tokens. Provide wallet, token, action, amount (lamports for buy) or percentage (bps for sell), and slippage. Outputs a base58-encoded transaction ready for signing.

Instructions

Build an unsigned Solana swap tx via REST. Returns base58 swap_tx. Pass to submit_signed_swap or use auto_swap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_addressYes
token_addressYes
actionYes
amountNoLamports (buy only)
holdings_percentageNoBps (sell only, 10000=100%)
slippageNo
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It discloses that the transaction is unsigned and returns base58, but lacks details on side effects, error conditions, or authentication needs. It gives the core behavioral trait but misses richer context expected for a mutation 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 only two sentences, with no superfluous words. It front-loads the action and method in the first sentence, and the output and next steps in the second. Every sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 6 parameters, no output schema, and no annotations, the description is too sparse to fully understand the tool's behavior. It does not explain the return format beyond 'base58 swap_tx', nor error conditions or dependencies. Given the complexity, more detail is needed.

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 33% (only amount and holdings_percentage have descriptions). The description adds no parameter-level information, failing to compensate for the missing schema descriptions. For example, it does not explain wallet_address, token_address, action, or slippage beyond what the schema provides.

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?

Description clearly states it builds an unsigned Solana swap transaction via REST. It specifies the output (base58 swap_tx) and distinguishes from siblings by mentioning submit_signed_swap and auto_swap as next steps or alternatives.

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?

The description provides clear usage flow: build the unsigned tx, then either pass to submit_signed_swap or use auto_swap. However, it does not explicitly state when not to use this tool or contrast with other swap-related siblings beyond those two.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TradeRouter/trade-router-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server