Skip to main content
Glama

Build Buy Transaction

ai_build_buy_tx
Read-onlyIdempotent

Build an unsigned buy transaction against the AiCurve contract. Returns calldata only; the caller signs and sends it. Includes an estimated gas limit when from is given. The minimum $AI out is the live quote minus slippage_bps, so a price move past that tolerance makes the tx revert instead of filling worse. Use ai_quote_buy to preview without building; use ai_build_sell_tx to sell.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNo0x sender address; when given the tx includes a gas estimate
hypeYesHYPE amount to spend, decimal string, max 10000
slippage_bpsNoSlippage tolerance in basis points, 0-5000, default 200

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
txYes
quoteYes
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": {
      +        "minTokensOut": {
      +          "type": "string"
      +        },
      +        "slippageBps": {
      +          "type": "integer"
      +        },
      +        "tokensOut": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "tokensOut",
      +        "minTokensOut",
      +        "slippageBps"
      +      ],
      +      "type": "object"
      +    },
      +    "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": [
      +    "tx",
      +    "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 declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, and the description adds valuable behavioral context beyond that: it returns calldata only, includes a gas estimate conditionally on 'from', and enforces a minimum output via slippage that causes reverts on adverse price moves. This gives the agent a strong mental model of execution behavior without contradicting 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?

The description is compact and every sentence earns its place. It front-loads the primary purpose and output, then adds conditional gas-estimate behavior, slippage protection semantics, and sibling routing in a tight, well-ordered format.

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 an output schema, so return values are already covered. The description supplies the remaining context an agent needs: when to use it, what it returns, how gas estimation works, how slippage affects reverts, and which sibling tools to use instead. Nothing important is missing for correct invocation.

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 description coverage is 100%, so the schema already documents all parameters. The description adds meaningful semantics by explaining that 'from' triggers a gas estimate, that 'hype' is the spend amount, and that 'slippage_bps' determines the minimum acceptable output and revert behavior. This goes beyond simply restating the schema.

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 states a specific verb ('Build'), a clear resource ('unsigned buy transaction against the AiCurve contract'), and the core output ('Returns calldata only'). It also differentiates itself from siblings by naming ai_quote_buy and ai_build_sell_tx, so an agent can distinguish this from related tools.

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?

The description explicitly tells the agent when to use this tool versus alternatives: 'Use ai_quote_buy to preview without building; use ai_build_sell_tx to sell.' It also clarifies that the caller signs and sends the returned calldata, making the tool's role in a larger workflow clear.

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