Skip to main content
Glama

x402_approve

Approve a contract to spend your tokens. Required before DeFi operations like swaps, lending, or staking.

Instructions

Approve a contract to spend your tokens. Required before some DeFi operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenNoToken to approveUSDs
amountYesAmount to approve (use 'unlimited' for max)
spenderYesContract address to approve
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It implies a mutation by saying 'approve' but does not explain side effects, irreversibility, gas costs, security risks of granting token spending rights, or what the return value represents. This is a significant gap for a state-changing financial operation.

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 extremely concise: two short sentences with no filler. It front-loads the core action and provides a usage hint. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite full schema coverage, this is a mutation tool with no annotations and no output schema. The description lacks essential context such as the supported network(s), the fact that this submits an on-chain transaction, the implications of unlimited approval, and the ability to revoke. An agent would not have enough information to safely invoke this tool without additional assumptions.

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 input schema already provides full descriptions for all three parameters (token, amount, spender), including the 'unlimited' hint for amount. The tool description adds no additional parameter semantics beyond restating the concept of 'your tokens', so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: approve a contract to spend your tokens. It uses a specific verb and resource, but it does not distinguish from sibling tools like approve_token_spending or x402_approve_service, which likely perform similar functions.

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?

Provides clear context for when to use: required before some DeFi operations. However, it does not explicitly mention alternatives or exclusion cases, leaving room for ambiguity about which approve-related tool to choose.

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/nirholas/universal-crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server