Skip to main content
Glama

approve_token

Authorize smart contracts to transfer your ERC-20 tokens for DeFi interactions like trading or lending. Specify exact amounts or grant unlimited approval.

Instructions

Approve a spender contract to transfer ERC-20 tokens on your behalf. Required before interacting with any DeFi protocol (DEXs, lending, etc.). Use amount "max" for unlimited approval, or specify an exact amount.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idYesWallet ID
tokenYesERC-20 token contract address
spenderYesContract address to approve as spender
amountYesAmount to approve in human-readable format (e.g. "1000"), or "max" for unlimited
chain_idYesChain ID
decimalsNoToken decimals (6 for USDC, 18 for most tokens)
Behavior3/5

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

With no annotations provided, the description carries full burden. It clearly describes the core behavior (authorizing token transfers by a spender contract) and mentions security implications ('unlimited approval' vs 'exact amount'). However, it doesn't disclose other important behavioral traits like whether this requires gas fees, confirmation times, reversibility, or error conditions. The description adds value but leaves gaps for a mutation tool.

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 perfectly front-loaded with the core purpose in the first sentence, followed by usage context and parameter guidance. Both sentences earn their place by providing essential information without redundancy. The structure moves from general to specific efficiently.

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

Completeness3/5

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

For a mutation tool with 6 parameters, no annotations, and no output schema, the description is reasonably complete about purpose and usage but lacks details about behavioral consequences, return values, and error handling. It covers the 'why' and basic 'how' but not the full operational context an agent would need for safe 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 baseline is 3. The description adds meaningful context for the 'amount' parameter by explaining the special 'max' value and contrasting it with exact amounts, which goes beyond the schema's technical description. However, it doesn't provide similar context for other parameters like 'decimals' or 'chain_id'.

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 specific action ('Approve a spender contract to transfer ERC-20 tokens on your behalf') and distinguishes it from siblings like 'get_allowance' (which checks approvals) and 'transfer_token' (which executes transfers). It specifies the resource (ERC-20 tokens) and the authorization relationship (spender contract acting on behalf).

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 to use this tool ('Required before interacting with any DeFi protocol (DEXs, lending, etc.)') and provides clear alternatives for the 'amount' parameter ('Use amount "max" for unlimited approval, or specify an exact amount'). It distinguishes from siblings by emphasizing this as a prerequisite authorization step.

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/hifriendbot/agentwallet-mcp'

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