Skip to main content
Glama

Build Sell Transaction

ai_build_sell_tx
Read-onlyIdempotent

Build the unsigned transaction(s) to sell $AI: an approve first if allowance is insufficient, then the sell. Returns calldata only; the caller signs and sends, in order. When an approve is included, send the sell after the approve is mined and estimate its gas then. The minimum HYPE out is the net quote minus slippage_bps. Use ai_quote_sell to preview without building; use ai_build_buy_tx to buy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aiYes$AI amount to sell, decimal string, max 1000000000
fromYes0x seller address, required to check allowance and estimate gas
slippage_bpsNoSlippage tolerance in basis points, 0-5000, default 200

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
quoteYes
stepsYes
disclosureYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "disclosure": {
      +      "type": "string"
      +    },
      +    "quote": {
      +      "properties": {
      +        "hypeOut": {
      +          "type": "string"
      +        },
      +        "minHypeOut": {
      +          "type": "string"
      +        },
      +        "slippageBps": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "hypeOut",
      +        "minHypeOut",
      +        "slippageBps"
      +      ],
      +      "type": "object"
      +    },
      +    "steps": {
      +      "items": {
      +        "properties": {
      +          "note": {
      +            "type": "string"
      +          },
      +          "step": {
      +            "enum": [
      +              "approve",
      +              "sell"
      +            ],
      +            "type": "string"
      +          },
      +          "tx": {
      +            "properties": {
      +              "chainId": {
      +                "type": "string"
      +              },
      +              "data": {
      +                "type": "string"
      +              },
      +              "from": {
      +                "type": "string"
      +              },
      +              "gas": {
      +                "type": "string"
      +              },
      +              "to": {
      +                "type": "string"
      +              },
      +              "value": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "chainId",
      +              "to",
      +              "value",
      +              "data"
      +            ],
      +            "type": "object"
      +          }
      +        },
      +        "required": [
      +          "step",
      +          "tx"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "steps",
      +    "quote",
      +    "disclosure"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark readOnlyHint=true and destructiveHint=false, and the description builds on this by explaining the tool returns calldata only (caller signs and sends), that an approve may be included and must be mined before the sell, and that minimum HYPE out is net quote minus slippage. It does not contradict the 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?

Three sentences, no filler, with the core purpose front-loaded. Every sentence earns its place: purpose, behavioral contract, and routing to alternatives.

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 transaction-building tool with an output schema, the description covers all critical operational details: approve-first logic, sequencing, gas estimation timing, minimum out calculation, and pointer to the quote preview tool. Nothing an agent needs to invoke it correctly is missing.

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%, so baseline is 3. The description adds meaning to slippage_bps by explaining how it determines the minimum HYPE out, which goes beyond the schema's 'slippage tolerance' definition. The ai and from parameters are not further elaborated, but the schema already fully documents them.

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 opens with a specific verb and resource: 'Build the unsigned transaction(s) to sell $AI'. It also differentiates from siblings by explicitly naming ai_quote_sell (preview) and ai_build_buy_tx (buy), leaving no ambiguity about what this tool does.

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 explicit when-to-use guidance ('to sell $AI'), when-not-to-use (use ai_quote_sell to preview, ai_build_buy_tx to buy), and precise sequencing requirements: send approve first, wait for it to be mined, then estimate gas for the sell. This is the gold standard for usage guidance.

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