Skip to main content
Glama

approve_permit2

One-time ERC-20 approval of a token to the Permit2 contract, needed before paying x402 "upto" endpoints with that token. A normal on-chain transaction (needs gas).

Instructions

One-time ERC-20 approval of a token to the Permit2 contract, needed before paying x402 "upto" endpoints with that token. A normal on-chain transaction (needs gas). By default approves the maximum, the ecosystem norm, so it never has to be repeated; pass amount to grant a bounded allowance instead (required under AGENTWALLET_MAX_TX_TOKEN and under a spend policy, both of which refuse a max approval; under a policy the allowance counts against the budgets). Permit2 itself only moves what each signed authorization allows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesERC-20 token address (e.g. USDC on Base)
amountNoAllowance to grant in human units (e.g. "100"). Omit for unlimited.
chain_idYesChain ID
wallet_idYesWallet ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.14.2

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: it discloses that this is an on-chain transaction needing gas, that the default is a maximum approval (the ecosystem norm, so no repeat), that max approvals are refused under certain configs, and that allowance under a policy counts against budgets. This is exactly the kind of operational context annotations would otherwise supply.

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?

Front-loaded with purpose, then gas, then default behavior, then the amount caveat. It is dense and the trailing sentence about Permit2's own limits borders on tangential, but every sentence carries real information for correct invocation.

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?

For a no-annotation, no-output-schema mutation tool, the description covers everything needed: what it does, that it costs gas, the default allowance and its policy implications, and the safety mechanism (Permit2 only moves what signed authorizations allow). Nothing critical is missing.

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%, so the schema documents all four parameters. The description still adds value beyond it by explaining the semantics of omitting amount (unlimited) versus passing it (bounded allowance) and the policy consequences of each, which goes past the schema's terse 'Omit for unlimited.'

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 (approve) plus a precisely scoped resource (ERC-20 token to the Permit2 contract), and the 'Permit2' qualifier distinguishes it from the sibling approve_token. An agent can tell exactly what operation this performs without opening the 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?

Explicitly states when it is needed ('before paying x402 upto endpoints with that token') and when to deviate ('pass amount ... required under AGENTWALLET_MAX_TX_TOKEN and under a spend policy'). It stops short of naming the alternative tool (approve_token) or when not to use this at all, so it is clear context without explicit routing.

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