Skip to main content
Glama

safe_approve

Read-onlyIdempotent

Exact-amount approve calldata — never unlimited — Unlimited allowances are the #1 drain vector, and agents reach for approve(max) on every swap. This builds ready-to-sign calldata for an approval of EXACTLY the amount you need (via the token's decimals) and refuses unlimited unless forced. Reads the live allowance and returns a revoke step first when one is already set (a non-zero→non-zero approve reverts on USDT-style tokens). Build-time prevention, not detection; we never hold keys. Not financial advice. Required inputs: token, spender, amount. Priced $0.02 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No API key required.

Input Schema

NameRequiredDescriptionDefault
ownerNoYour wallet (optional, reads live allowance)
tokenYesToken contract
amountYesExact amount to approve (or 'max')
spenderYesSpender (router/contract)
allowUnlimitedNoAllow unlimited (1 = yes, not recommended)

Output Schema

NameRequiredDescriptionDefault
dataNoThe result payload. Shape is service-specific; every field is documented in the tool description.
serviceNoThe service id that answered.
checkedAtNoISO-8601 timestamp of when the underlying reads were taken.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond annotations (readOnlyHint/idempotentHint only say it is a safe read): it discloses live-allowance reads, the non-zero→non-zero revert risk on USDT-style tokens, refusal of unlimited unless forced, x402 pricing/auth model, free daily call, and that no keys are held. Nothing contradicts the annotations.

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?

Dense and front-loaded with the core behavior and safety rationale, but carries some promotional/boilerplate weight ('#1 drain vector', 'Not financial advice') that a routing agent does not strictly need.

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?

An output schema exists, so return format need not be described. The description still covers pricing, auth, refusal behavior, and the edge case that triggers a prepended revoke step — enough for correct invocation of a 5-param tool.

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 already 100%, but the description adds real meaning: it names the three required inputs, explains that amount is resolved through the token's decimals, notes 'max' as an accepted value, and warns that allowUnlimited is 'not recommended'.

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?

States a specific verb+resource: builds ready-to-sign calldata for an exact-amount token approval, including a refusal path for unlimited. It also implicitly distinguishes itself from detection-oriented siblings ('approval_advisor', 'token_approvals') by declaring 'build-time prevention, not detection'.

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 clear context ('agents reach for approve(max) on every swap') and the condition under which it refuses or prepends a revoke, but never explicitly routes the agent to specific alternatives (e.g. revoke_builder for pure revocation or approval_advisor for auditing existing grants).

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