Skip to main content
Glama

Multi-protocol lending health & rescue calldata builder

defi_position_shield
Read-onlyIdempotent

Stress-tests Aave/Compound health factors under collateral drops and builds unsigned repay and revoke transactions to guard a DeFi wallet against liquidation and stale approvals.

Instructions

[$0.04] Trigger When: guarding a DeFi wallet against liquidation or stale approvals. Workflow Outcome: stress-tests Aave/Compound health factor (-10%/-20%) and builds unsigned repay & revoke txs. Do not use for pool yield discovery (use defi_yield_pools) or wallet PnL logs (use wallet_treasury_pnl). The -10% and -20% collateral drops are fixed stress simulations, while target_health_factor sets the safety target used to size unsigned_aave_repay_tx. Live Aave/Compound RPCs, read-only non-custodial (no broadcast); requires x402 USDC or Stripe MPP (10 free lifetime calls via /api/free/*) at 30-60 req/min.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "defi_position_shield"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoEVM chain (base, ethereum, arbitrum, optimism)base
walletNo0x wallet address to inspect
session_tokenNoOptional prepaid session token (x402s_...) from https://apix402data.com/pay after the 10-call free preview.
target_health_factorNoTarget Aave health factor (1.1-5.0)

Output Schema

NameRequiredDescriptionDefault
chainNo
cachedNo
walletNo
aave_v3No
degradedNo
endpointNo
rpc_sourceNo
non_custodialNo
schema_versionNo
usdc_wallet_balanceNo
compound_v3_usdc_debtNo
unsigned_aave_repay_txNo
unsigned_multicall3_revoke_txNo
stale_unlimited_usdc_approvalsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint=false, idempotent and openWorld, and the description adds real context on top: live RPCs, non-custodial, no broadcast, pricing, free-tier limits and rate limits. The one gap is that it doesn't say what the stress output looks like or whether the -10%/-20% simulation results are returned separately.

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?

One dense paragraph, front-loaded with trigger, outcome, exclusions and constraints, with no filler sentences. The leading price tag is slightly awkward placement but does not obscure the purpose.

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?

Given an output schema exists, return values need not be explained, and the description covers the mutation-sensitive points (unsigned calldata, no broadcast), auth/payment requirements and rate limits. Nothing an agent needs in order to call it correctly 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 100%, so the baseline is 3, but the description adds genuine meaning: it clarifies that -10%/-20% are fixed stress simulations while target_health_factor is the safety target used to size unsigned_aave_repay_tx. That distinction is not derivable from the schema alone.

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 names a specific verb and resource set: stress-testing Aave/Compound health factors and building unsigned repay & revoke transactions for a wallet. It explicitly separates this from defi_yield_pools and wallet_treasury_pnl, so an agent can tell the scope apart from siblings without opening a 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?

It gives an explicit 'Trigger When' condition (guarding a wallet against liquidation or stale approvals) and two named exclusions with the alternative tool for each. The when/when-not routing is fully specified rather than implied.

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