Skip to main content
Glama

Build ERC20.approve(spender, amount) calldata

dexe_vote_build_erc20_approve
Read-only

Build ERC20 approve calldata for DeXe staking: allow a spender, typically the DAO's GovUserKeeper, to use your tokens before depositing. Returns calldata only, no broadcast.

Instructions

Builds calldata; does not broadcast. ERC20.approve(spender, amount). Run it before dexe_vote_build_deposit when staking an ERC20: approve the DAO's GovUserKeeper (dexe_dao_info), never the GovPool. Native-coin staking needs no approve — pass value on deposit instead.

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": {
      "token": "<token>",
      "spender": "<spender>",
      "amount": "<amount>"
    },
    "name": "dexe_vote_build_erc20_approve"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesERC20 token contract address to approve.
amountYesAllowance in the ERC20 at `token`, that token's own decimals. RAW base units, digits only ('1500000000000000000' = 1.5 at 18 dec); '1.5' is REJECTED — scale it, or use dexe_proposal_create. Unlimited = max uint256, i.e. '115792089237316195423570985008687907853269984665640564039457584007913129639935'
chainIdNoChain this payload targets: 56 mainnet, 97 testnet. Default: the configured chain.
govPoolNoDAO GovPool. When set, an approve to it (instead of its GovUserKeeper) is refused.
spenderYesFor deposits: the DAO's GovUserKeeper address (NOT the GovPool)

Output Schema

NameRequiredDescriptionDefault
payloadYes
warningsNo
advisoriesNoDeprecated — use warnings.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.37.1

TDQS

A4.5/5.0
Behavior4/5

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

readOnlyHint=true is consistent with a calldata builder, and the description reinforces it with 'does not broadcast', which is the key behavioral fact an agent needs to know (no on-chain effect). It also discloses the refusal rule for approving a GovPool directly. It does not discuss failure modes or error behavior beyond that, which keeps it just short of the top score.

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?

Four short sentences, zero filler, and the most decision-relevant facts (builds only, which function, run before deposit, native-coin exception) are front-loaded. Nothing could be removed without losing routing or safety information.

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 calldata-builder with full schema coverage, an output schema, and readOnlyHint annotations, the description supplies exactly the missing pieces: sequencing relative to deposit, correct spender target, and the native-coin exception. An agent has everything needed to call it correctly.

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 token, amount, spender, chainId and govPool are already fully documented with formats and constraints. The description's guidance on using GovUserKeeper rather than GovPool restates what the spender and govPool schema fields already say, adding little new parameter meaning.

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 gives a specific verb and resource ('Builds calldata', 'ERC20.approve(spender, amount)') and immediately bounds scope with 'does not broadcast'. It also names the exact siblings involved (dexe_vote_build_deposit, dexe_dao_info), so an agent can distinguish this builder from the deposit and info tools without opening a schema.

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 states explicit ordering ('Run it before dexe_vote_build_deposit when staking an ERC20'), the correct target address ('approve the DAO's GovUserKeeper, never the GovPool'), and an explicit when-not case with the alternative ('Native-coin staking needs no approve — pass `value` on deposit instead'). Both the positive and negative paths are covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.