Skip to main content
Glama

Quote a position swap (v4)

get_position_swap_quote
Read-only

v4 only. Quote swapping one Aave v4 position for another, atomically and without leaving the protocol: kind=supply swaps collateral for a different collateral asset, kind=borrow swaps one debt for another. Both sides are on the same spoke. Get 'sellPosition' from get_position_items, whose 'quotableAs' says whether that item can be sold this way (supplySwapFrom or borrowSwapFrom), and 'buyReserve' from get_markets, whose 'quotableAs' says whether that reserve can receive it (supplySwapTo or borrowSwapTo). The quoteId feeds prepare_order. Nothing is committed until the user signs, so state the plan rather than asking permission to quote it.

Input Schema

NameRequiredDescriptionDefault
kindYessupply = collateral swap, borrow = debt swap.
userYesWallet address (0x, 40 hex).
amountYesAmount in main units of the sold position, e.g. '100.5'.
versionNoOptional, and only 'v4': this tool exists on v4 only.
buyReserveYesreserveId to move into (from get_markets), on the same spoke as the position sold.
slippagePctNoOptional max slippage as a percent string, e.g. '0.5'. Omit to accept the backend suggestion.
sellPositionYespositionItemId to sell (from get_position_items): a supply item for kind=supply, a borrow item for kind=borrow.
enableCollateralNokind=supply only: enable the bought reserve as collateral (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false; the description reinforces this with 'Nothing is committed until the user signs' and adds a workflow norm ('state the plan rather than asking permission to quote it'). It does not cover quote expiry/lifetime or rate-limit characteristics, so it stops just short of full behavioral disclosure.

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?

Front-loaded with the v4-only constraint and the two-kind distinction, then dependencies, then downstream use, then the behavioral note. Every sentence carries actionable information and nothing is redundant.

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?

Covers scope, prerequisites, downstream wiring, and safety posture for an 8-parameter quote tool. With no output schema, it only lightly implies the return shape (quoteId) and says nothing about the quote's other fields such as the suggested slippage or expected rates, which is a minor remaining gap.

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 baseline is 3; the description still adds real value by tying sellPosition and buyReserve to their source tools and by stating the same-spoke constraint and the quoteId-to-prepare_order linkage. It restates kind semantics already in the schema, so the gain is incremental rather than substantial.

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 swapping one Aave v4 position for another, atomically and without leaving the protocol') and immediately disambiguates the two modes: kind=supply swaps collateral, kind=borrow swaps debt. It is clearly distinguishable from token-swap siblings like get_swap_quote.

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?

Explicitly names the upstream dependencies (get_position_items for sellPosition, get_markets for buyReserve) and the gating fields (quotableAs: supplySwapFrom/borrowSwapFrom, supplySwapTo/borrowSwapTo), plus the downstream consumer (prepare_order via quoteId). It does not explicitly contrast with get_swap_quote or get_repay_with_supply_quote, which would have completed the routing guidance.

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