Skip to main content
Glama

Quote a leveraged position (v4)

get_leverage_quote
Read-only

v4 only. Quote opening or increasing a leveraged position in one atomic order: the debt reserve is flash-loaned, swapped into the collateral reserve and supplied, and the debt is drawn against it to repay the flash loan. Both reserves are reserveIds from get_markets in this session, on the same spoke: pick a debtReserve whose 'quotableAs' lists leverageDebt and a collateralReserve whose 'quotableAs' lists leverageCollateral. Returns the quote with a quoteId (feeds preview_action and prepare_order), the approvals to sign first, and maxSafeMultiplier - the multiplier at which the position becomes liquidatable, which a requested multiplier must stay under. Nothing is committed until the user signs, so state the plan rather than asking permission to quote it.

Input Schema

NameRequiredDescriptionDefault
userYesWallet address (0x, 40 hex) of the wallet that will sign, as the user named it in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected.
versionNoOptional, and only 'v4': this tool exists on v4 only.
multiplierNoTarget exposure multiplier (target collateral / entry equity), e.g. '2.5'. Strictly greater than 1, and it must stay under the quote's maxSafeMultiplier. Omit the argument entirely to be quoted at a multiplier the backend picks from how closely the two assets track each other.
debtReserveYesreserveId of the asset borrowed (flash-loaned, then owed as debt), from get_markets.
slippagePctNoOptional max slippage as a percent string, e.g. '0.5'. Omit to accept the backend suggestion.
enableCollateralNoWhether the supplied collateral backs borrowing (default true, which the leverage loop requires). Omit unless the user asked otherwise.
collateralReserveYesreserveId of the asset bought and supplied as collateral, from get_markets.
additionalCollateralNoExtra collateral pulled from the wallet (via permit) on top of existing collateral, in the collateral asset's main units. Required when the wallet has no existing collateral in that reserve; otherwise omit the argument entirely unless the user wants to top up.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true, and the description is consistent while adding substance the annotations can't: it explains the flash-loan/swap/supply/draw mechanics, that nothing is committed until the user signs, and what comes back (quoteId, approvals, maxSafeMultiplier). The maxSafeMultiplier constraint on a requested multiplier is exactly the kind of behavioral limit an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences, front-loaded with the version constraint and the core action, each carrying operational information (reserve selection rule, return contents, signing semantics). Slightly heavy as a single block, but nothing is padding.

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 an 8-parameter tool with no output schema, the description covers the missing piece — the shape of the response (quoteId, approvals to sign, maxSafeMultiplier) — plus prerequisites and the follow-on tools that consume the quoteId. An agent has everything needed to call this correctly and use the result.

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%, so the baseline is 3; the description earns above that by adding cross-parameter meaning the schema cannot express — the two reserves must be on the same spoke and satisfy the 'quotableAs' pair constraint, and the requested multiplier must stay under maxSafeMultiplier. It doesn't restate the optional params (slippagePct, enableCollateral, additionalCollateral), but the schema covers those fully.

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?

States a specific verb and resource ('Quote opening or increasing a leveraged position in one atomic order') and immediately distinguishes itself from the swap/repay quote siblings by naming the leverage loop. The 'v4 only' scope is front-loaded, so an agent knows both what it does and where it lives.

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

Usage Guidelines4/5

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

Gives real selection guidance: both reserves must come from get_markets in this session, on the same spoke, with debtReserve listing leverageDebt in 'quotableAs' and collateralReserve listing leverageCollateral. It also routes downstream ('feeds preview_action and prepare_order') and clarifies the quoting-vs-committing boundary. It does not explicitly name the sibling quote tools it replaces (get_swap_quote, get_position_swap_quote), so no exclusion rule.

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