Skip to main content
Glama

ERC-20 allowance check (x402)

get_chain_allowance

Read-onlyIdempotent

How much of an ERC-20 token a spender is approved to move from an owner's wallet, via allowance, across Base, Ethereum, Optimism, Arbitrum, Polygon, Gnosis. The approval read every DeFi, swap and trading agent makes before (and after) a transaction to know if an approve is needed. Live public RPC; one paid call.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_chain_allowance"
  }
}

Input Schema

NameRequiredDescriptionDefault
x_paymentNoSigned x402 payment payload

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and openWorld, so safety is covered. The description adds genuinely non-redundant behavior: data comes from a live public RPC and costs 'one paid call', which matters for call planning. It does not describe the returned value's format (e.g. raw integer vs. decimal-adjusted amount).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the actual definition and followed by the use case. The phrasing 'The approval read every DeFi, swap and trading agent makes' is slightly promotional but still carries real usage information, so little is wasted.

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?

Covers purpose, chains, data source and cost, which is solid for a read tool with annotations. However, with no output schema the description should clarify what 'how much' looks like (raw uint256, token decimals) and should state that owner, spender and token address must be supplied, since those are absent from the input schema.

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?

The single schema parameter (x_payment) is fully described as a signed x402 payment payload, so the schema does the work. The description introduces the semantic inputs — owner, spender, token, chain — that do not appear in the schema at all, which is useful, but it never states they are required or how they are passed.

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?

Names the specific verb and resource ('how much of an ERC-20 token a spender is approved to move from an owner's wallet, via allowance') and enumerates the supported chains. That is clearly distinguishable from sibling reads like get_chain_erc20_balance or get_chain_nonce without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete usage context: the approval read agents make 'before (and after) a transaction to know if an approve is needed.' That tells the agent when to reach for it. It stops short of naming an alternative tool or stating exclusions, so it is clear context rather than full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources