Skip to main content
Glama

zerox_build_tx

Build an unsigned 0x Swap API (AllowanceHolder) transaction plus ERC-20 approval tx if needed; output goes to sender. Same fees as zerox_quote (0.1% ours + 0x's ~0.15% zeroExFee).

Input Schema

NameRequiredDescriptionDefault
chainYes
amountYes
senderYes
tokenInYes
tokenOutYes
slippageBpsNo

Output Schema

NameRequiredDescriptionDefault
txYes
feeYesDisclosed Quietwork fee (already reflected in expectedOut)
noteYes
chainYes
venueYes
gasFeeNo
issuesNo
minOutNo
chainIdYes
tokenInYes
amountInYes
approvalNoPresent for ERC-20 input tokens
tokenOutYes
minOutWeiNo
zeroExFeeNo0x's own platform fee, on top of ours
amountInWeiYes
expectedOutYes
slippageBpsYes
expectedOutWeiYes
totalNetworkFeeWeiNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "amountIn": {
      +      "type": "string"
      +    },
      +    "amountInWei": {
      +      "type": "string"
      +    },
      +    "approval": {
      +      "description": "Present for ERC-20 input tokens",
      +      "properties": {
      +        "amount": {
      +          "type": "string"
      +        },
      +        "note": {
      +          "type": "string"
      +        },
      +        "required_if_allowance_below": {
      +          "type": "string"
      +        },
      +        "spender": {
      +          "type": "string"
      +        },
      +        "token": {
      +          "type": "string"
      +        },
      +        "tx": {
      +          "properties": {
      +            "chainId": {
      +              "type": "integer"
      +            },
      +            "data": {
      +              "type": "string"
      +            },
      +            "from": {
      +              "type": "string"
      +            },
      +            "gas": {
      +              "type": "string"
      +            },
      +            "to": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "description": "0x hex wei",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "chainId",
      +            "to",
      +            "data",
      +            "value",
      +            "from"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "required_if_allowance_below",
      +        "token",
      +        "spender",
      +        "tx"
      +      ],
      +      "type": "object"
      +    },
      +    "chain": {
      +      "type": "string"
      +    },
      +    "chainId": {
      +      "type": "integer"
      +    },
      +    "expectedOut": {
      +      "type": "string"
      +    },
      +    "expectedOutWei": {
      +      "type": "string"
      +    },
      +    "fee": {
      +      "description": "Disclosed Quietwork fee (already reflected in expectedOut)",
      +      "properties": {
      +        "amountWei": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "bps": {
      +          "type": "number"
      +        },
      +        "note": {
      +          "type": "string"
      +        },
      +        "percent": {
      +          "type": "number"
      +        },
      +        "receiver": {
      +          "type": "string"
      +        },
      +        "takenFrom": {
      +          "type": "string"
      +        },
      +        "token": {
      +          "type": "string"
      +        },
      +        "venue": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "bps",
      +        "percent",
      +        "takenFrom",
      +        "receiver",
      +        "note"
      +      ],
      +      "type": "object"
      +    },
      +    "gasFee": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "issues": {
      +      "type": "object"
      +    },
      +    "minOut": {
      +      "type": "string"
      +    },
      +    "minOutWei": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "slippageBps": {
      +      "type": "integer"
      +    },
      +    "tokenIn": {
      +      "properties": {
      +        "address": {
      +          "type": "string"
      +        },
      +        "decimals": {
      +          "type": "integer"
      +        },
      +        "symbol": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "address",
      +        "decimals",
      +        "symbol"
      +      ],
      +      "type": "object"
      +    },
      +    "tokenOut": {
      +      "properties": {
      +        "address": {
      +          "type": "string"
      +        },
      +        "decimals": {
      +          "type": "integer"
      +        },
      +        "symbol": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "address",
      +        "decimals",
      +        "symbol"
      +      ],
      +      "type": "object"
      +    },
      +    "totalNetworkFeeWei": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "tx": {
      +      "properties": {
      +        "chainId": {
      +          "type": "integer"
      +        },
      +        "data": {
      +          "type": "string"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "gas": {
      +          "type": "string"
      +        },
      +        "to": {
      +          "type": "string"
      +        },
      +        "value": {
      +          "description": "0x hex wei",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "chainId",
      +        "to",
      +        "data",
      +        "value",
      +        "from"
      +      ],
      +      "type": "object"
      +    },
      +    "venue": {
      +      "const": "0x"
      +    },
      +    "zeroExFee": {
      +      "description": "0x's own platform fee, on top of ours",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "venue",
      +    "chain",
      +    "chainId",
      +    "tokenIn",
      +    "tokenOut",
      +    "amountIn",
      +    "amountInWei",
      +    "expectedOut",
      +    "expectedOutWei",
      +    "fee",
      +    "slippageBps",
      +    "tx",
      +    "note"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

C2.9/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 behavioral burden. It usefully discloses that the transaction is unsigned, may include an ERC-20 approval, that output goes to the sender, and the fee structure, but it does not address authentication, rate limits, or whether any state change occurs.

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 single compact sentence is front-loaded with the core action and avoids filler. The fee details are secondary but still relevant, and no sentence is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema covers return values, but this is a six-parameter build tool with no annotations and no schema descriptions. The description omits required parameter meanings, auth/rate-limit behavior, and practical usage context, so it is not complete enough for reliable invocation.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must explain the six parameters. It does not define chain, tokenIn, tokenOut, amount, slippageBps, or the precise role of sender, leaving required inputs undocumented.

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?

The description states a specific verb and resource: build an unsigned 0x Swap API transaction plus an ERC-20 approval tx if needed. It is clearer than a generic build tool, but it does not explicitly differentiate usage from siblings such as zerox_quote or swap_build_tx beyond mentioning shared fees.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus zerox_quote or other *_build_tx siblings. The description implies it is for constructing a transaction, but it does not state prerequisites such as whether a quote should be obtained first or when approval handling matters.

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