Skip to main content
Glama

prepare_morpho_withdraw_collateral

DestructiveIdempotent

Build an unsigned Morpho Blue transaction to withdraw collateral from a market and return it to your wallet. Only exact amounts; check deposited collateral via get_morpho_positions first.

Instructions

Build an unsigned Morpho Blue withdrawCollateral transaction — removes collateral from a market to send back to the wallet. Only withdraws the exact amount specified; "max" is NOT supported because Morpho's isolated-market accounting doesn't expose a clean max-safe value without simulating against the market's oracle/LLTV (query get_morpho_positions first to know your deposited collateral). Will revert on-chain if the withdrawal would push the position below the liquidation threshold. No approval step needed. Returns a handle + preview for Ledger signing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYes0x-prefixed EVM wallet address (40 hex chars) that will execute this action.
chainNoEVM chain Morpho Blue is deployed on. Currently only ethereum is enabled.ethereum
marketIdYesMorpho Blue market id — 32-byte hex (0x + 64 hex chars). Identifies the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Discover via get_morpho_positions.
amountYesHuman-readable decimal amount, NOT raw wei/base units. Example: "10" for 10 USDC. Pass "max" for full-balance withdraw/repay.
Behavior5/5

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

Annotations indicate destructive and idempotent, but the description adds details: it reverts on-chain if below liquidation threshold, no approval needed, and returns a handle+preview for Ledger signing. It explains why 'max' is not supported, which is behavioral context beyond annotations. No contradictions with annotations, but there is a contradiction with the schema's amount description.

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?

The description is well-structured with a clear first sentence stating the purpose, followed by important constraints and context. It is slightly verbose but still concise for the amount of information conveyed. Each sentence adds value, and the key points are front-loaded.

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?

Given the tool's complexity (4 parameters, no output schema), the description covers all critical aspects: purpose, constraints, prerequisites (query positions), on-chain behavior, and return format. It is sufficiently complete for an agent to understand when and how to use the tool.

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 description adds crucial semantic information by clarifying that 'max' is not supported, overriding the schema's misleading suggestion. It reinforces that amount should be exact human-readable decimals. This adds value beyond the schema's parameter descriptions, though it creates a contradiction with the schema.

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 builds an unsigned Morpho Blue withdrawCollateral transaction, specifying the action and resource. It distinguishes from siblings by focusing on collateral withdrawal and explicitly stating that 'max' is not supported, which contrasts with other withdraw tools. The verb 'build' and the target 'Morpho Blue withdrawCollateral' are specific.

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 advises that 'max' is not supported and instructs to query get_morpho_positions first to know deposited collateral. It mentions that no approval step is needed, and implies that this tool is for withdrawing collateral, not borrowed assets (use prepare_morpho_withdraw). This provides clear when-to and when-not-to usage.

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/szhygulin/recon-crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server