Skip to main content
Glama

hyperd.liquidation.risk

Assess cross-protocol liquidation risk for a wallet's lending positions. Get health factor, USD-at-risk, and recommendations across Aave V3, Compound v3, Spark Lend, and Morpho Blue.

Instructions

Cross-protocol liquidation risk for a wallet's lending positions. Health factor, USD-at-risk, and recommendations across Aave V3, Compound v3, Spark Lend, and Morpho Blue. Pass chain='all' for cross-chain aggregate. Costs $0.10 in USDC.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes0x EVM wallet address
chainNoChain to check, or 'all' for cross-chain aggregate. Default 'base'.

Implementation Reference

  • src/server.ts:357-369 (registration)
    Registration of the 'hyperd.liquidation.risk' tool using server.tool() with name, description, Zod schema for address and chain inputs, and a handler that calls paidGet('/api/liquidation/risk').
    // hyperd.liquidation.risk — cross-protocol lending liquidation health ($0.10)
    server.tool(
      "hyperd.liquidation.risk",
      "Cross-protocol liquidation risk for a wallet's lending positions. Health factor, USD-at-risk, and recommendations across Aave V3, Compound v3, Spark Lend, and Morpho Blue. Pass chain='all' for cross-chain aggregate. Costs $0.10 in USDC.",
      {
        address: z.string().describe("0x EVM wallet address"),
        chain: z
          .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb", "all"])
          .optional()
          .describe("Chain to check, or 'all' for cross-chain aggregate. Default 'base'."),
      },
      async (args) => asText(await paidGet("/api/liquidation/risk", args)),
    );
  • Handler logic for 'hyperd.liquidation.risk' – an async function that calls paidGet('/api/liquidation/risk') with the args (address, chain) and wraps the result via asText().
    // hyperd.liquidation.risk — cross-protocol lending liquidation health ($0.10)
    server.tool(
      "hyperd.liquidation.risk",
      "Cross-protocol liquidation risk for a wallet's lending positions. Health factor, USD-at-risk, and recommendations across Aave V3, Compound v3, Spark Lend, and Morpho Blue. Pass chain='all' for cross-chain aggregate. Costs $0.10 in USDC.",
      {
        address: z.string().describe("0x EVM wallet address"),
        chain: z
          .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb", "all"])
          .optional()
          .describe("Chain to check, or 'all' for cross-chain aggregate. Default 'base'."),
      },
      async (args) => asText(await paidGet("/api/liquidation/risk", args)),
    );
  • Zod input schema for the tool: address (required string) and chain (optional enum of chains including 'all', defaults to 'base').
    // hyperd.liquidation.risk — cross-protocol lending liquidation health ($0.10)
    server.tool(
      "hyperd.liquidation.risk",
      "Cross-protocol liquidation risk for a wallet's lending positions. Health factor, USD-at-risk, and recommendations across Aave V3, Compound v3, Spark Lend, and Morpho Blue. Pass chain='all' for cross-chain aggregate. Costs $0.10 in USDC.",
      {
        address: z.string().describe("0x EVM wallet address"),
        chain: z
          .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb", "all"])
          .optional()
          .describe("Chain to check, or 'all' for cross-chain aggregate. Default 'base'."),
      },
      async (args) => asText(await paidGet("/api/liquidation/risk", args)),
    );
  • paidGet() helper function that constructs the URL, appends query params, and calls paidRequest('GET', ...) to make an x402-authenticated paid HTTP request to the hyperD API.
    async function paidGet(
      path: string,
      query: Record<string, string | number | boolean | undefined>,
    ): Promise<unknown> {
      if (!httpClient) {
        throw new Error(WALLET_NOT_CONFIGURED_MSG);
      }
    
      const url = new URL(`${API_BASE}${path}`);
      for (const [k, v] of Object.entries(query)) {
        if (v !== undefined && v !== "" && v !== null) url.searchParams.set(k, String(v));
      }
      return paidRequest("GET", url, undefined);
    }
  • asText() helper that wraps the JSON response into the MCP content format (array with a single text content block).
    function asText(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It mentions a cost of $0.10 USDC, which is useful, but does not clarify if the tool is read-only, any side effects, or rate limits, leaving some behavioral characteristics unaddressed.

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 three sentences, front-loaded with the main purpose, and each sentence adds value: purpose, outputs/protocols, usage hint and cost. No wasted words.

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?

With 2 fully-described params and no output schema, the description covers outputs (health factor, USD-at-risk, recommendations) and cost, but lacks detail on the return structure or format. Still, it provides sufficient context for an agent to understand the tool's purpose and basic usage.

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?

Schema coverage is 100% with both address and chain already well-described. The description adds context by listing protocols and outputs, but for the parameters themselves it adds little beyond the schema, warranting a baseline score of 3.

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 states the tool assesses cross-protocol liquidation risk for a wallet, listing specific protocols (Aave V3, Compound v3, Spark Lend, Morpho Blue) and outputs (health factor, USD-at-risk, recommendations), distinguishing it from sibling tools like hyperd.wallet.risk or hyperd.health.check.

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?

The description implies use for checking liquidation risk and mentions passing chain='all' for cross-chain aggregate, but does not explicitly state when to use this tool versus alternatives or any prerequisites or limitations.

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/hyperd-ai/hyperd-mcp'

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