Skip to main content
Glama

DeFi Slippage, MEV & Liquidation Math Guard

ingravity_computeDefiSlippageAndLiquidation
Read-onlyIdempotent

Calculate exact AMM swap math, slippage, MEV sandwich bounds, and perpetual liquidation thresholds to assess DeFi trade risk and liquidation exposure.

Instructions

Calls /api/v1/defi-math-guard ($0.10 Full / $0.04 Essential USDC via x402 v2) for exact 18-decimal BigInt AMM swap math, 48-step MEV sandwich bounds, and perpetual liquidation thresholds.

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": "ingravity_computeDefiSlippageAndLiquidation"
  }
}

Input Schema

NameRequiredDescriptionDefault
ammNo
tierNoFULL
leverageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, open-world), so the description's added value is the payment and transport layer: a specific HTTP endpoint, USDC pricing tiers ($0.10 Full / $0.04 Essential via x402 v2), which tells the agent this is a paid remote call with a cost decision. It does not disclose latency, rate limits, or the shape of returned math.

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?

A single front-loaded sentence with no filler; the endpoint and the three output domains appear immediately. It is dense but not padded, though the parenthetical pricing sits mid-sentence and slightly interrupts the purpose statement.

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?

For a tool with nested objects, zero schema descriptions, and no output schema, the description should clarify what results come back and how the amm and leverage blocks relate (all parameters are optional, so partial input behavior is undefined). It covers the 'what' and the cost but leaves the agent guessing about input contract and return values.

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 0% and the input is two nested objects with inner fields (feeBps, userSlippageBps, maintenanceMarginBps, entryPrice, leverage, side) that carry no descriptions anywhere. The description adds almost nothing: it only indirectly explains 'tier' via the Full/Essential price split, leaving every numeric field's units, scaling, and required-vs-optional combinations unaddressed.

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 states a specific verb-plus-resource pair — calling /api/v1/defi-math-guard — and enumerates the three computations it performs: 18-decimal BigInt AMM swap math, 48-step MEV sandwich bounds, and perpetual liquidation thresholds. That is far more concrete than the tool name alone and is clearly distinct from audit/encode/decode siblings. It stops short of explicitly contrasting itself with those siblings.

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

Usage Guidelines3/5

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

Usage is only implied through the described computation outputs; there is no explicit when-to-use, when-not-to-use, or prerequisite framing (e.g., whether leverage math requires the amm block). The pricing/tier note is commercial context, not selection guidance.

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