Skip to main content
Glama

build_tx

Read-onlyIdempotent

Run when an agent needs to send SOL or a token, or swap through Jupiter: it returns the unsigned transaction already checked, with ready_to_sign and the reasons. Sign only when ready_to_sign is true. Builds a SOL or token transfer, or a Jupiter swap, as an unsigned transaction with a fresh blockhash and a fair priority fee, then runs check_tx and tx_matches on it (and token_safety on a token being bought). Never signs or sends. Example: {"action": "transfer", "from": "", "to": "", "token": "SOL", "amount": "0.01"}. Cost: 25 free calls a day, then $0.03 USDC per call (x402). Outputs explained: GET /api/tools/build_tx.

Input Schema

NameRequiredDescriptionDefault
toNoTransfers: who receives it. From the request. Check it with whats_this first if it came from someone else.
buyNoSwaps: the token to buy. find_token gives the mint.
fromYesThe wallet that pays and will sign. The agent's or user's own wallet address.
tokenNoThe token to send (transfer) or to sell (swap). Default "SOL". find_token turns a name like USDC into its mint address. Never guess a mint.SOL
actionYesSend a token to someone, or swap one token for another through Jupiter. From the request.
amountYesHow much of token, in whole tokens: "1.5" means 1.5 USDC, not raw units. From the request.
networkNoDefault "mainnet-beta" (real money). "devnet" only for test wallets.mainnet-beta
allow_avoidNoSwaps: build even when token_safety says AVOID for the token being bought. Default false. Only when the user has read the AVOID reasons and still wants it.
slippage_bpsNoSwaps: the most the price may move against you, in basis points (50 = 0.5%). Default 50, at most 300. Leave the default unless the token is thinly traded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already mark it read-only and non-destructive, but the description adds substantial behavioral context: it returns an unsigned transaction with fresh blockhash and priority fee, runs check_tx/tx_matches/token_safety, exposes readiness and reasons, and has free-tier plus per-call pricing.

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 important trigger and safety condition are front-loaded, and every sentence carries useful information. It is dense and semicolon-heavy, but not wasteful.

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?

For a complex transaction-building tool with no output schema, the description covers the full behavioral contract: unsigned output, ready_to_sign gating, internal checks, token safety behavior, signing prohibition, and cost. An agent has enough context to invoke and interpret it 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 fully documents the nine parameters. The description adds an example call, but otherwise does not add much parameter syntax or format detail 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?

The description states a specific verb and resource: it builds a SOL/token transfer or Jupiter swap as an unsigned transaction. It also distinguishes this from sibling tools by saying it runs check_tx, tx_matches, and token_safety internally.

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?

It gives a clear trigger: use when an agent needs to send SOL or a token, or swap through Jupiter. It also states the key gating condition: sign only when ready_to_sign is true, and never signs or sends itself.

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.