Skip to main content
Glama

Build an unsigned swap transaction

build_swap_tx
Read-only

Convert a swap quote ID into unsigned transaction data for the user's wallet to sign and submit. Build promptly after quoting, as quotes expire.

Instructions

Turn a quoteId from get_quote into transaction data for the swap. Returns an UNSIGNED transaction: this server never holds keys, never signs and never broadcasts. The calling agent (or the user's wallet) signs and submits it. Quotes expire, so build shortly after quoting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quoteIdYesquoteId from a get_quote result
userAddressYesSender address the transaction is built for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark readOnlyHint=true; the description reinforces this by explicitly stating the server never holds keys, signs, or broadcasts. Adds the quote-expiry behavior and designates the caller as the signer. No contradiction with annotations.

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?

Four clear sentences, each adding distinct information: purpose, unsigned/safety model, signer responsibility, and timing. No redundant or filler wording; important constraints are front-loaded.

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 two-parameter tool with annotations, the description covers the output type (unsigned transaction), the security boundary (no signing/broadcasting), the prerequisite (quoteId), and the freshness requirement. Although no output schema exists, the description discloses the essential return information, making it complete enough for correct invocation.

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 already describes both quoteId and userAddress with 100% coverage. The description adds a small clarification that quoteId originates from get_quote, but this largely mirrors the schema. Baseline 3 applies because the schema carries the parameter documentation.

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 action ('Turn a quoteId... into transaction data') and identifies the resource (swap transaction). Clearly distinguishes from sibling tools like get_quote by referencing it as the input source and by specifying the unsigned-transaction output.

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?

Provides clear context: use after get_quote and before quote expiry. Mentions the prerequisite quoteId and that the transaction is subsequently signed/submitted by the caller. Does not explicitly name sibling alternatives or negative conditions, but the context is sufficient.

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