Skip to main content
Glama

swap_txn

Build an unsigned token swap transaction on Humble Swap and return it base64-encoded for signing, so agents can prepare swaps without handling private keys.

Instructions

Build unsigned transactions to swap tokens on Humble Swap. Returns base64-encoded transactions for signing via UluWalletMCP.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fromToken": "<fromToken>",
      "toToken": "<toToken>",
      "amount": "<amount>",
      "sender": "<sender>"
    },
    "name": "swap_txn"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountYesAmount to swap in human-readable units
senderYesSender wallet address
toTokenYesTo token symbol or contract ID
slippageNoAllowed slippage percentage (default 5)
fromTokenYesFrom token symbol or contract ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does disclose the important trait that the output is unsigned base64 transactions requiring signing via UluWalletMCP, which tells the agent this is non-custodial and not a completing swap. It omits slippage behavior beyond the schema default, fee handling, and what happens on an invalid pair, which are material for a transaction-building 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?

Two short sentences, zero filler, with the core action front-loaded and the return value immediately after. Nothing needs trimming and nothing is buried.

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 5-parameter transaction builder with full schema coverage and a stated return format (base64-encoded unsigned transactions), an agent has enough to invoke it correctly. The remaining gap is ordering relative to get_swap_route/get_quote, which is a usage rather than completeness concern.

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%, including the slippage default of 5, so the baseline is 3. The description adds no meaning beyond the schema — no clarification of token symbol vs contract ID resolution or of human-readable amount units.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Build unsigned transactions to swap tokens on Humble Swap.' That clearly separates it from the read-only siblings (get_swap_route, get_quote) and from add/remove_liquidity_txn. It stops short of naming a sibling or explicitly contrasting with the route/quote tools, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer 'use this when you actually want to execute a swap,' but the description never says to call get_swap_route or get_quote first, nor when not to use it. No prerequisites or preconditions (e.g., route validation, sufficient balance) are stated.

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