Skip to main content
Glama

write.wallet.approve

Idempotent

Build an unsigned approval transaction for ERC20 tokens or ERC721/ERC1155 NFTs. Required before depositing or adding liquidity. Check allowance first to skip if sufficient.

Instructions

Build an unsigned approval transaction. For ERC20 tokens: generates approve(spender, amount). For ERC721/ERC1155 NFTs (e.g. LP positions): generates setApprovalForAll(operator, true). Required before write.account.deposit or write.account.add_liquidity (when depositing from wallet). Tip: call read.wallet.allowances first to check if approval already exists — skip this if the current allowance is sufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address to approve
spender_addressYesAddress being approved — use the Arcadia account address for deposits
asset_typeNoToken type: 'erc20' (default) for fungible tokens, 'erc721' or 'erc1155' for NFTs (LP positions)erc20
amountNoERC20 only: amount in raw units, or 'max_uint256' for unlimited. Ignored for NFTs.max_uint256
chain_idNoChain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes
transactionYes
predicted_account_addressNo
Behavior5/5

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

The description discloses that the tool builds an unsigned transaction (no side effects), matches idempotentHint=true, and explains behavioral differences between token types. Annotations already confirm safe mutation (destructiveHint=false), and description adds context without contradiction.

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 sentences, each essential: core function, token-type differentiation, prerequisite usage, and a practical tip. No superfluous content; information is front-loaded and well-organized.

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?

Given the tool's multi-token nature and prerequisite role, the description covers all key aspects: purpose, token behavior, required context (before deposit/add_liquidity), and a best-practice tip. Output schema exists, so return details are handled elsewhere.

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 beyond the schema by clarifying that amount is for ERC20 only and spender_address should be the Arcadia account address, enhancing parameter understanding.

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 clearly states the tool builds unsigned approval transactions for tokens, specifying two cases (ERC20 approve, ERC721/ERC1155 setApprovalForAll). It also explicitly connects to its prerequisite role for other tools, distinguishing it from sibling write 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 states when this tool is required (before write.account.deposit and add_liquidity) and advises checking allowances first via read.wallet.allowances, effectively communicating when to use and when to skip.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arcadia-finance/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server