Skip to main content
Glama

get_allowance

Check ERC-20 token allowance for a spender to determine if approval is needed before DeFi transactions. Returns both raw and human-readable amounts.

Instructions

Check how many ERC-20 tokens a spender is approved to transfer. Returns the allowance in both raw and human-readable format. Use this to check if an approval is needed before a DeFi transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idYesWallet ID (used to determine the owner address)
tokenYesERC-20 token contract address
spenderYesSpender contract address to check
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 the full burden of behavioral disclosure. It describes the return format ('in both raw and human-readable format') and the read-only nature implied by 'check', but lacks details on potential errors, rate limits, authentication needs, or network behavior. It adds some context but leaves gaps for a tool interacting with blockchain data.

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 two sentences with zero waste: the first states the core functionality and return format, the second provides usage guidance. Every word earns its place, and key information is front-loaded.

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?

Given no annotations and no output schema, the description does well by explaining the return format and usage context. However, for a blockchain tool with 5 parameters and potential complexity (e.g., network calls, error cases), it could benefit from more behavioral details like what happens on invalid inputs or network failures.

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 all 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain relationships between parameters like how wallet_id maps to owner address). Baseline 3 is appropriate when the schema does the heavy lifting.

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's purpose with specific verbs ('check', 'returns') and resources ('ERC-20 tokens', 'allowance'), distinguishing it from siblings like get_balance or get_token_balance by focusing on spender approval amounts rather than ownership balances. It explicitly mentions what the tool does and what it returns.

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 provides explicit guidance on when to use this tool ('to check if an approval is needed before a DeFi transaction'), which differentiates it from alternatives like approve_token (which sets approvals) and get_balance (which checks ownership). It clearly states the practical context for usage.

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