Skip to main content
Glama

How a position's risk premium is built up (v4)

get_risk_premium
Read-only

v4 only. The per-collateral breakdown of one position's risk premium: how much of the position each token is, and the weight the protocol charges for it. 'currentRiskPremiumWeightPct' is the weight in force now and 'latestRiskPremiumWeightPct' the one the protocol has moved to, so the two differing is the point - the position has been repriced and has not caught up, and the borrow rate will follow. Use it to answer why a v4 borrow costs what it does when the reserve's headline rate says otherwise. 'spokeId' comes from get_user_positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userYesWallet address, 0x-prefixed (40 hex chars).
spokeIdYesspokeId from get_user_positions (not the spoke address).
versionNoOptional, and only 'v4': this tool exists on v4 only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already mark this as read-only and non-destructive. The description adds significant context: it explains the meaning of the two weight fields (current vs latest) and that their difference indicates a repriced position that hasn't caught up, affecting the borrow rate. This goes beyond the annotations by revealing the interpretive insight. However, it does not mention potential edge cases (e.g., missing collateral) or the exact output structure beyond these fields.

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 dense yet efficient. It leads with 'v4 only' to set scope, then states the purpose, explains the two key fields, gives a use case, and ends with a parameter dependency. Each sentence serves a distinct purpose with no filler. The structure is logical and front-loaded with the most critical constraint.

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?

Given there is no output schema, the description compensates by explaining the two key output fields (currentRiskPremiumWeightPct and latestRiskPremiumWeightPct) and their behavioral meaning. It also covers the use case and parameter provenance. It does not describe the full output shape (e.g., whether it returns a list or single object), but for a read-only tool with clear annotations, the provided context is largely sufficient.

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?

Schema coverage is 100% for required parameters (user and spokeId have descriptions, version has an enum). The description adds a crucial hint: spokeId comes from get_user_positions, which is not in the schema. This dependency clarification goes beyond the schema and helps the agent source the correct value. No additional syntax or format is needed beyond what the schema provides.

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's function: it provides a per-collateral breakdown of a position's risk premium, including token composition and protocol weight. It also specifies the version (v4 only) and differentiates from reserve headline rates by explaining the use case for why a borrow rate might deviate. This distinguishes it from related tools like get_reserve_details or get_interest_rate_model.

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 description explicitly states when to use this tool: 'Use it to answer why a v4 borrow costs what it does when the reserve's headline rate says otherwise.' It also notes that spokeId comes from get_user_positions, indicating a prerequisite and source. It does not name alternatives but provides a clear trigger scenario, which is sufficient for a niche tool.

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