Skip to main content
Glama
iinniitt

DeFi Guard MCP

by iinniitt

approval_risk

Assess an ERC-20 approval's risk on Base: checks live allowance, flags unlimited approvals, and verifies if spender is a contract to prevent allowance-drain scams.

Instructions

Assess the risk of an existing ERC-20 approval on Base BEFORE it can be abused: reads the live allowance an owner has granted a spender, flags UNLIMITED approvals (the allowance-drain vector — a compromised or malicious spender can pull up to the allowance), and reports whether the spender is a contract. Unlimited allowance to an EOA is a classic scam setup. Use before signing an approval, or to audit standing approvals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesThe wallet that granted the approval
tokenYesThe ERC-20 token address
spenderYesThe address allowed to spend (router, contract, or EOA)
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing it reads live allowance, flags unlimited approvals, and reports contract status. It also explains the unlimited-allowance drain vector and EOA scam setup, adding useful behavioral context, though it omits return format or explicit read-only confirmation.

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?

Three dense, well-structured sentences lead with the core purpose, unpack behavior via a colon, and end with concrete use cases. Every sentence earns its place with no filler or repetition.

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?

Despite no output schema, the description covers the key outputs (flags unlimited approvals, reports contract status) and provides purpose, chain, and use cases. It does not detail return shape or error behavior, but enough context is present for an agent to select and invoke the tool correctly.

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?

The schema already describes all three parameters with 100% coverage, but the description adds risk-specific meaning by tying owner/token/spender to the allowance-drain vector and describing spender as a router, contract, or EOA. This enriches the bare field names and helps correct usage.

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 identifies the action (assess risk), resource (existing ERC-20 approval on Base), and key behaviors (reads live allowance, flags unlimited approvals, reports spender contract status). This distinguishes it from sibling tools focused on swaps, token risk, or position health.

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?

It explicitly states when to use: before signing an approval or to audit standing approvals. It does not name alternative tools or exclusions, but the use cases are unambiguous and clearly differentiate it from the listed siblings.

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/iinniitt/defi-guard-mcp'

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