Skip to main content
Glama
clumsynonono

Aave Liquidation MCP Server

by clumsynonono

get_aave_reserves

Retrieve all available assets and their configurations from Aave V3 protocol to analyze positions and identify liquidation opportunities.

Instructions

Get list of all available reserves (assets) in Aave V3 protocol with their configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_aave_reserves': validates no params needed, calls aaveClient.getAllReserves(), formats reserves data with parsed LTV, liquidation threshold/bonus, and returns as JSON text content.
    case 'get_aave_reserves': {
      const reserves = await aaveClient.getAllReserves();
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                totalReserves: reserves.length,
                reserves: reserves.map((r) => ({
                  symbol: r.symbol,
                  address: r.tokenAddress,
                  decimals: r.decimals,
                  ltv: parseFloat((Number(r.ltv) / 10000).toFixed(4)),
                  liquidationThreshold: parseFloat((Number(r.liquidationThreshold) / 10000).toFixed(4)),
                  liquidationBonus: parseFloat(((Number(r.liquidationBonus) - 10000) / 10000).toFixed(4)),
                  canBeCollateral: r.usageAsCollateralEnabled,
                  canBeBorrowed: r.borrowingEnabled,
                  isActive: r.isActive,
                })),
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/index.ts:96-104 (registration)
    Tool registration in ListToolsResponse: defines name 'get_aave_reserves', description, and empty inputSchema (no parameters required).
    {
      name: 'get_aave_reserves',
      description:
        'Get list of all available reserves (assets) in Aave V3 protocol with their configuration.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema definition: empty object since no input parameters are required.
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • Core helper function implementing reserve fetching: caches results (1min TTL), fetches reserve tokens, parallel queries for configurations and decimals from data provider and ERC20 contracts, constructs ReserveData array.
    async getAllReserves(): Promise<ReserveData[]> {
      // Return cached data if still valid
      const now = Date.now();
      if (this.reserveCache && (now - this.reserveCacheTime) < this.CACHE_TTL) {
        return this.reserveCache;
      }
    
      const reserveTokens = await this.dataProviderContract.getAllReservesTokens();
    
      // Parallel query all configurations and decimals
      const configPromises = reserveTokens.map((reserve: { tokenAddress: string }) =>
        this.dataProviderContract.getReserveConfigurationData(reserve.tokenAddress)
      );
      const decimalsPromises = reserveTokens.map((reserve: { tokenAddress: string }) => {
        const tokenContract = new ethers.Contract(reserve.tokenAddress, ERC20_ABI, this.provider);
        return tokenContract.decimals();
      });
    
      const [configs, decimalsList] = await Promise.all([
        Promise.all(configPromises),
        Promise.all(decimalsPromises),
      ]);
    
      const reserves: ReserveData[] = reserveTokens.map(
        (reserve: { symbol: string; tokenAddress: string }, index: number) => ({
          symbol: reserve.symbol,
          tokenAddress: reserve.tokenAddress,
          decimals: Number(decimalsList[index]),
          ltv: configs[index].ltv,
          liquidationThreshold: configs[index].liquidationThreshold,
          liquidationBonus: configs[index].liquidationBonus,
          usageAsCollateralEnabled: configs[index].usageAsCollateralEnabled,
          borrowingEnabled: configs[index].borrowingEnabled,
          isActive: configs[index].isActive,
        })
      );
    
      // Update cache
      this.reserveCache = reserves;
      this.reserveCacheTime = now;
    
      return reserves;
    }
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. It states the tool retrieves a list with configuration, but does not disclose critical traits like whether it's read-only, requires authentication, has rate limits, or details the return format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that front-loads the key action and resource. It uses minimal words to convey the essential information without any waste, making it highly concise and well-structured.

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 complexity (simple read operation with 0 parameters) and lack of annotations/output schema, the description is adequate but has clear gaps. It explains what the tool does but misses behavioral context and usage guidelines. This meets the minimum viable standard but could be more complete.

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?

The input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description does not add parameter details, which is acceptable here. Baseline is 4 for 0 parameters, as it avoids redundancy and focuses on the tool's purpose.

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 clearly states the verb 'Get' and the resource 'list of all available reserves (assets) in Aave V3 protocol with their configuration.' It specifies the scope (all available reserves) and the protocol version (V3). However, it does not explicitly differentiate from siblings like 'get_asset_price' or 'get_user_positions,' which would require a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention when-not scenarios or refer to sibling tools for related tasks, such as using 'get_asset_price' for pricing data or 'get_user_positions' for user-specific reserves. This lack of context leaves usage unclear.

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