Skip to main content
Glama

Build or quote unsigned DeFi transaction

build_defi_tx
Read-only

READ-ONLY / UNSIGNED: build an unsigned DeFi transaction payload (supply, redeem, borrow, repay, claim) or quote LP amounts (quote_lp) via the official Binance Web3 DeFi API. Never signs, never broadcasts, never touches private keys — returns unsigned contract calldata (and optional simulation result) for wallet signing or CLI inspection.

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": {
      "action": "<action>",
      "investmentId": "<investmentId>"
    },
    "name": "build_defi_tx"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYesDeFi transaction builder action: supply|redeem|borrow|repay|claim|quote_lp.
amountNoToken amount in human units or base units (required for supply|redeem|borrow|repay|quote_lp).
chainIdNoOptional chain slug or chainId (e.g. ethereum, bnb, arbitrum, base, polygon, optimism, avalanche, linea, sonic, solana).
simulateNoWhen true (default), also runs Binance Web3 DeFi transaction simulation on the unsigned payload.
slippageBpsNoOptional slippage tolerance in basis points (default 50 = 0.5%).
investmentIdYesBinance Web3 DeFi investmentId (from read_defi scope=investments).
tokenAddressNoOptional input/output token contract address (defaults to investment primary token).
walletAddressNoUser wallet address (0x... for EVM or base58 for Solana). Required for supply|redeem|borrow|repay|claim.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description is consistent with them. It adds useful behavioral context — no signing, no broadcasting, no private keys, unsigned calldata plus optional simulation — but says nothing about API rate limits, auth requirements, or failure modes for an open-world API call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the safety-critical 'READ-ONLY / UNSIGNED' label, with no wasted framing. The triple 'never signs, never broadcasts, never touches private keys' is slightly repetitive against the READ-ONLY label but earns its place as explicit behavior.

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?

No output schema exists, and the description does disclose the return value (unsigned contract calldata, optional simulation result). For an 8-parameter, open-world, write-preparation tool it is mostly complete; chain selection defaults and any rate/limit behavior are the remaining gaps.

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%, so the schema already documents every parameter including defaults for simulate and slippageBps and per-action requirements. The description adds only the enumeration of actions and the quote_lp path, which largely restates the schema enum.

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?

States specific verbs and resources: 'build an unsigned DeFi transaction payload (supply, redeem, borrow, repay, claim)' plus 'quote LP amounts (quote_lp)'. The 'READ-ONLY / UNSIGNED' framing and the contrast with 'never signs, never broadcasts' implicitly separates it from execution-oriented siblings like execute_trade.

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?

Makes the usage context explicit: the output is meant 'for wallet signing or CLI inspection', and it routes the agent to read_defi scope=investments to obtain investmentId. It does not name a sibling to use instead when the caller actually wants to sign or broadcast, so a small inference remains.

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.