Skip to main content
Glama

Get Lending Rates

get_lending_rates
Read-only

Get current on-chain lending supply/borrow APYs for Aave v3 reserves and Compound v3 markets on Ethereum or Base, with per-asset snapshots and Compound utilization. Use for protocol-specific yield comparisons such as USDC on Aave vs Compound.

Use when: Use for protocol-specific lending-rate questions (e.g. 'Aave vs Compound USDC rates'). Prefer over get_yield_rates when the protocols are known; use get_yield_rates for broad pool discovery across many protocols. Do not fall back to web_search when this returns errors — report them.

Limitations: On-chain snapshots of Aave v3 and Compound v3 on Ethereum and Base only; not a multi-protocol yield aggregator. Rates are point-in-time and change per block. Returns an errors list — report each unavailable protocol explicitly and treat empty rates with empty errors as transient RPC unavailability.

Alternatives: get_yield_rates, get_defi_positions, get_liquidation_risk

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetsNoOptional asset-symbol filter (e.g., ['USDC','DAI']). Case-insensitive. Max 20 symbols.
chain_idNoChain ID (1=Ethereum, 8453=Base).
protocolNoProtocol to query: 'aave-v3', 'compound-v3', or 'all'.all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoOn-chain lending market snapshot at data_block_number. Aave rates are derived from ProtocolDataProvider.getReserveData (ray-scaled). Compound rates are derived from Comet getUtilization/getSupplyRate/getBorrowRate (per-second 1e18-scaled), annualized to APY.
ratesYes
errorsNo
chain_idYes
protocolYes
data_block_numberYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / assets / title
      Added value: +"Assets"
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / protocol / title
      Added value: +"Protocol"
    • addedInput schema / title
      Added value: +"mcp_get_lending_ratesArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "LendingRateEntry": {
      +    "properties": {
      +      "asset_symbol": {
      +        "title": "Asset Symbol",
      +        "type": "string"
      +      },
      +      "borrow_apy_pct": {
      +        "title": "Borrow Apy Pct",
      +        "type": "number"
      +      },
      +      "chain_id": {
      +        "title": "Chain Id",
      +        "type": "integer"
      +      },
      +      "market_name": {
      +        "title": "Market Name",
      +        "type": "string"
      +      },
      +      "protocol": {
      +        "enum": [
      +          "aave-v3",
      +          "compound-v3"
      +        ],
      +        "title": "Protocol",
      +        "type": "string"
      +      },
      +      "source": {
      +        "const": "on-chain",
      +        "default": "on-chain",
      +        "title": "Source",
      +        "type": "string"
      +      },
      +      "supply_apy_pct": {
      +        "title": "Supply Apy Pct",
      +        "type": "number"
      +      },
      +      "utilization_pct": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Utilization Pct"
      +      }
      +    },
      +    "required": [
      +      "protocol",
      +      "chain_id",
      +      "market_name",
      +      "asset_symbol",
      +      "supply_apy_pct",
      +      "borrow_apy_pct"
      +    ],
      +    "title": "LendingRateEntry",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / rates / items / $ref
      Added value: +"#/$defs/LendingRateEntry"
    • removedOutput schema / properties / rates / items / properties
      Removed value: -{
      -  "asset_symbol": {
      -    "title": "Asset Symbol",
      -    "type": "string"
      -  },
      -  "borrow_apy_pct": {
      -    "title": "Borrow Apy Pct",
      -    "type": "number"
      -  },
      -  "chain_id": {
      -    "title": "Chain Id",
      -    "type": "integer"
      -  },
      -  "market_name": {
      -    "title": "Market Name",
      -    "type": "string"
      -  },
      -  "protocol": {
      -    "enum": [
      -      "aave-v3",
      -      "compound-v3"
      -    ],
      -    "title": "Protocol",
      -    "type": "string"
      -  },
      -  "source": {
      -    "const": "on-chain",
      -    "default": "on-chain",
      -    "title": "Source",
      -    "type": "string"
      -  },
      -  "supply_apy_pct": {
      -    "title": "Supply Apy Pct",
      -    "type": "number"
      -  },
      -  "utilization_pct": {
      -    "anyOf": [
      -      {
      -        "type": "number"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null,
      -    "title": "Utilization Pct"
      -  }
      -}
    • removedOutput schema / properties / rates / items / required
      Removed value: -[
      -  "protocol",
      -  "chain_id",
      -  "market_name",
      -  "asset_symbol",
      -  "supply_apy_pct",
      -  "borrow_apy_pct"
      -]
    • removedOutput schema / properties / rates / items / title
      Removed value: -"LendingRateEntry"
    • removedOutput schema / properties / rates / items / type
      Removed value: -"object"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With only readOnlyHint=true in annotations, the description carries the behavioral burden and does so thoroughly. It discloses the errors list behavior, the point-in-time nature of rates, the 'empty rates with empty errors' transient RPC condition, and the protocol scope limitation. This goes well beyond what annotations convey and does not contradict them.

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 well-structured with clear sections ('Use when', 'Limitations', 'Alternatives') and the core purpose is front-loaded in the first sentence. Every sentence adds either usage guidance, behavioral context, or routing information, with no filler or repetition of schema details.

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?

For a read-only query tool with an output schema present, the description covers purpose, selection criteria, limitations, error-reporting expectations, and alternatives. It is complete enough for an agent to invoke it correctly, including edge cases like empty errors and per-block rate changes, without needing additional context.

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%, so each parameter (assets, chain_id, protocol) is already documented with type, defaults, and constraints. The description adds context about per-asset snapshots and protocol-specific yield comparisons, but it does not materially extend the parameter semantics beyond what the schema provides. Baseline 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 opens with a specific verb ('Get'), a precise resource ('on-chain lending supply/borrow APYs'), and explicit scope ('Aave v3 reserves and Compound v3 markets on Ethereum or Base'). It distinguishes this tool from get_yield_rates by naming it directly, so an agent can tell them apart without opening schemas.

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?

The 'Use when' section gives explicit conditions ('protocol-specific lending-rate questions... Prefer over get_yield_rates when protocols are known'), provides a fallback rule ('use get_yield_rates for broad pool discovery'), and instructs the agent to report errors rather than falling back to web_search. Alternatives are also listed at the end, leaving no ambiguity about tool selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources