Skip to main content
Glama

Build MC↔MG Swap Transaction

build_amm_swap_tx

Build a two-step plan to swap MEGACHAD↔MEGAGOONER through MegaChadLP: ERC20.transfer(pair, amountIn) → pair.swap(amountAIn, amountBIn, to). MegaChadLP has no on-chain minOut — verify your received balance after the swap. Slippage is computed off-chain and surfaced as minOut.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesInput token
amountYesInput amount in human units (e.g. "1000")
recipientYesReceive address (0x...)
slippageBpsNoSlippage tolerance in bps (default 200 = 2%)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries full responsibility. It discloses the exact two-step mechanics (ERC20.transfer then swap), the absence of on-chain minOut, the need to verify received balance, and that slippage is only surfaced off-chain as minOut. These are critical behavioral traits that are not in the schema.

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 three sentences, front-loaded with the purpose, and every sentence provides essential information. The warning about minOut and off-chain slippage are valuable without redundancy.

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?

The tool has no output schema and no annotations, but the description specifies the output is a two-step plan (including the call sequence) and notes the safety verification needed. For a transaction builder, this is sufficiently complete for an agent to invoke it and interpret the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds meaning by explaining slippageBps is computed off-chain and surfaced as minOut, and that the transaction is a two-step sequence using amountIn/amountAIn/amountBIn. This bridges schema fields to the actual swap behavior, though it doesn't explicitly re-describe each parameter.

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 clearly states the tool builds a two-step swap plan for MEGACHAD↔MEGAGOONER via MegaChadLP, with an explicit transaction sequence. It distinguishes itself from siblings like build_amm_add_liquidity_tx and other build_* tools by specifying the swap action and assets.

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 intended use is clear from the purpose statement, but it does not explicitly name alternatives or exclusions. For example, it does not contrast with get_swap_quote for quotes or build_amm_add_liquidity_tx for liquidity. However, the context strongly implies when this tool is needed.

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.