Skip to main content
Glama

Diogenes Web3, DeFi & 402 Security MCP

EIP-712 Typed Data & Uniswap Permit2 Phishing Signature Decoder

decode_eip712_permit_signature
Read-onlyIdempotent

Decodes EIP-712 and Uniswap Permit2 off-chain typed-data payloads to verify spender identity, detect unlimited (uint256.max) token approvals, and flag expired deadlines. Use when inspecting an off-chain eth_signTypedData_v4 or Permit2 payload before signing; for decoding raw on-chain hex transaction calldata (0x...) for eth_sendTransaction, use simulate_evm_transaction_calldata instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'typed_data_json' ('chain_id' defaults to '1'), supports '?demo=true' or L402 (20 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
chain_idNoEVM chain ID used to verify canonical router spender addresses; defaults to '8453' (Base) when omitted.
typed_data_jsonYesJSON string or object containing the EIP-712 / Permit2 message (spender, amount, deadline).

Output Schema

NameRequiredDescriptionDefault
signing_verdictYesSafety recommendation ('SAFE_BOUNDED_PERMIT' or 'CRITICAL_UNLIMITED_APPROVAL_UNVERIFIED_SPENDER').
spender_addressYesNormalized lowercase EVM address of the permit spender.
spender_identityYesIdentified protocol router label or 'Unknown Third-Party Spender'.
unlimited_approval_detectedYesTrue if the approval value equals uint256.max / uint160.max.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (readOnly/idempotent/non-destructive), it discloses operational traits the agent cannot see elsewhere: stateless edge call, 32 KB payload cap, 60 RPM throttle, L402 payment option, demo mode, and HTTP 400 on invalid input. The only defect is that one of these operational details is wrong (see parameter note), so it stops just short of full trust.

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?

Purpose, verification targets, and the sibling alternative are front-loaded before the operational constraints. Dense but essentially waste-free; the final clause (demo/L402/400) is slightly crammed into one sentence, which is the only reason it is not a 5.

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?

Output schema exists, so return values need no explanation, and the description fully covers scope, safety profile, alternatives, and limits. It is near-complete for a 2-parameter read tool, with the chain_id default conflict the one gap that matters to correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description actively contradicts the schema: it says 'chain_id' defaults to '1' while the schema says it defaults to '8453' (Base). Since chain_id governs which canonical router spender addresses are used for verification, this error can cause a wrong-chain approval to be judged safe. It also references a '?demo=true' query flag that appears in neither parameter.

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 ('Decodes') plus the exact resource ('EIP-712 and Uniswap Permit2 off-chain typed-data payloads') and the outputs of interest (spender identity, uint256.max approvals, expired deadlines). It also contrasts itself with the sibling simulate_evm_transaction_calldata, so an agent can separate the off-chain signing case from raw calldata without opening either schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('inspecting an off-chain eth_signTypedData_v4 or Permit2 payload before signing') and an explicit when-not with the named alternative and its condition ('raw on-chain hex transaction calldata (0x...) for eth_sendTransaction, use simulate_evm_transaction_calldata instead'). Nothing is left to inference.

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.