approve_token_spending
Approve a spender address to spend your ERC20 tokens, enabling interactions with DeFi protocols, exchanges, or other contracts that require an allowance.
Instructions
Approve another address (like a DeFi protocol or exchange) to spend your ERC20 tokens. This is often required before interacting with DeFi protocols.
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": {
"privateKey": "<privateKey>",
"tokenAddress": "<tokenAddress>",
"spenderAddress": "<spenderAddress>",
"amount": "<amount>"
},
"name": "approve_token_spending"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | The amount of tokens to approve in token units, not wei (e.g., '1000' to approve spending 1000 tokens). Use a very large number for unlimited approval. | |
| privateKey | Yes | Private key of the token owner account in hex format (with or without 0x prefix). SECURITY: This is used only for transaction signing and is not stored. | |
| tokenAddress | Yes | The contract address of the ERC20 token to approve for spending (e.g., '0xA0b8...') | |
| spenderAddress | Yes | The contract address being approved to spend your tokens (e.g., a DEX or lending protocol) |