Skip to main content
Glama
clumsynonono

Aave Liquidation MCP Server

by clumsynonono

get_user_health

Check an Ethereum address's health factor on Aave V3 to monitor collateral, debt, and liquidation status for risk assessment.

Instructions

Get health factor and account data for a specific Ethereum address on Aave V3. Returns collateral, debt, and liquidation status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum address to check (must be a valid address)

Implementation Reference

  • src/index.ts:51-65 (registration)
    Tool registration in listTools handler including name, description, and input schema
    {
      name: 'get_user_health',
      description:
        'Get health factor and account data for a specific Ethereum address on Aave V3. Returns collateral, debt, and liquidation status.',
      inputSchema: {
        type: 'object',
        properties: {
          address: {
            type: 'string',
            description: 'Ethereum address to check (must be a valid address)',
          },
        },
        required: ['address'],
      },
    },
  • MCP tool handler: validates input address, fetches account data via AaveClient, formats response with health factor, positions, and status
    case 'get_user_health': {
      const address = args?.address as string;
      if (!address || typeof address !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'address parameter is required and must be a string'
        );
      }
    
      if (!aaveClient.isValidAddress(address)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid Ethereum address format'
        );
      }
    
      const accountData = await aaveClient.getUserAccountData(address);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                address: accountData.address,
                healthFactor: accountData.healthFactorFormatted,
                totalCollateralUSD: parseFloat(
                  ethers.formatUnits(accountData.totalCollateralBase, 8)
                ).toFixed(2),
                totalDebtUSD: parseFloat(
                  ethers.formatUnits(accountData.totalDebtBase, 8)
                ).toFixed(2),
                availableBorrowsUSD: parseFloat(
                  ethers.formatUnits(accountData.availableBorrowsBase, 8)
                ).toFixed(2),
                liquidationThreshold: parseFloat(
                  (Number(accountData.currentLiquidationThreshold) / 10000).toFixed(4)
                ),
                ltv: parseFloat((Number(accountData.ltv) / 10000).toFixed(4)),
                isLiquidatable: accountData.isLiquidatable,
                isAtRisk: accountData.isAtRisk,
                status: accountData.isLiquidatable
                  ? 'LIQUIDATABLE'
                  : accountData.isAtRisk
                  ? 'AT_RISK'
                  : 'HEALTHY',
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Core helper function: queries Aave V3 Pool contract for user account data, computes formatted health factor and liquidation risk flags
    async getUserAccountData(userAddress: string): Promise<UserAccountData> {
      const data = await this.poolContract.getUserAccountData(userAddress);
    
      const healthFactorFormatted = ethers.formatUnits(data.healthFactor, 18);
      const healthFactorNumber = parseFloat(healthFactorFormatted);
    
      return {
        address: userAddress,
        totalCollateralBase: data.totalCollateralBase,
        totalDebtBase: data.totalDebtBase,
        availableBorrowsBase: data.availableBorrowsBase,
        currentLiquidationThreshold: data.currentLiquidationThreshold,
        ltv: data.ltv,
        healthFactor: data.healthFactor,
        healthFactorFormatted,
        isLiquidatable: healthFactorNumber < LIQUIDATION_THRESHOLD && healthFactorNumber > 0,
        isAtRisk: healthFactorNumber < WARNING_THRESHOLD && healthFactorNumber > 0,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool returns specific data (collateral, debt, liquidation status), it doesn't describe error handling, rate limits, authentication needs, or whether it's a read-only operation. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, well-structured sentence that efficiently conveys the tool's purpose and output. It is front-loaded with the core action and resource, with no wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the purpose and return values but lacks details on behavioral traits, error handling, and usage context. Without annotations or an output schema, it doesn't fully compensate for these gaps.

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?

The schema description coverage is 100%, with the parameter 'address' fully documented in the input schema. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate.

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 specific action ('Get health factor and account data'), the resource ('for a specific Ethereum address on Aave V3'), and the scope ('Returns collateral, debt, and liquidation status'). It distinguishes itself from siblings like 'get_user_positions' by focusing on health metrics rather than general positions.

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 usage for checking health metrics on Aave V3, but provides no explicit guidance on when to use this tool versus alternatives like 'analyze_liquidation' or 'get_user_positions'. It doesn't mention prerequisites, exclusions, or comparative contexts with sibling tools.

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/clumsynonono/aave-liquidation-mcp'

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