Skip to main content
Glama

Build unsigned swap transaction

build_swap_transaction
Read-onlyIdempotent

Build an unsigned transaction for a quoted swap. Returns EVM fields (to/data/value) or a Solana base64 transaction, plus a verification block: routerAllowlisted, decodedSummary, minBuyAmount, approvalTarget. VERIFY BEFORE SIGNING — sign only if routerAllowlisted is true and the addresses match the published allowlist from get_meta.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyYes
sellYes
takerYesThe address that will sign and execute
amountYes
sourceYesVenue id from the quote (e.g. 'lifi', 'jupiter')
slippageBpsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, open-world, and non-destructive, and the description adds substantial context: the specific verification fields returned and the warning to sign only when routerAllowlisted is true. This is critical safety-relevant behavioral disclosure beyond the structured metadata.

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?

Three tight sentences with no filler. The purpose is front-loaded, the output shape is stated compactly, and the safety warning is placed prominently so the agent cannot miss it.

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

Completeness4/5

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

For a multi-chain transaction builder with no output schema, the description covers the output format and the verification workflow meaningfully. It could be slightly stronger on how inputs correspond to the quote, but it provides enough for correct invocation and safe handling.

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 low at 33%, and the description does not compensate by explaining any input parameters. It references a 'quoted swap' but does not clarify semantics for amount, slippageBps, or how buy/sell objects map to output. The taker and source descriptions in the schema help, but amount and slippage remain underdocumented.

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?

Begins with a specific verb and resource: 'Build an unsigned transaction for a quoted swap.' It also clarifies the output format (EVM fields or Solana base64) and the verification block, making its role distinct from quote-fetching or execution siblings.

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?

Clearly implies this tool is used after obtaining a quote and before signing. It gives strong safety guidance by directing the agent to verify routerAllowlisted against the allowlist from get_meta. It does not explicitly name an alternative or state when not to use it, but the quoted-swap precondition is evident.

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