Skip to main content
Glama

Prepare mandate collateral withdraw

prepare_mandate_withdraw_collateral
Read-onlyIdempotent

Move collateral from the position back to the account, never to any other address. "max" stops at the account's minimum ratio. Checks the account's limits, then returns UNSIGNED transaction data for the session key, simulated first. Above the approval threshold it returns EIP-712 typed data for the owner instead, which only works when the owner is an ordinary wallet: it refuses when the owner is a contract, such as a Safe. Never signs or sends.

Input Schema

NameRequiredDescriptionDefault
amountYesUSDG to withdraw as a decimal string, or "max"
marketYesMarket address (0x...) or symbol, e.g. NO-NVDA
accountYesMandate account address (0x...)
approvalNoOnly above the approval threshold: the nonce and deadline from typedData, plus the owner's signature
sessionKeyYesThe session key that will send it (0x...). Not held by this server
approvalTtlSecondsNoOptional: how long a new approval stays valid. Default 1 hour

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that nothing is signed or sent, that the call simulates first, and that the return type branches — unsigned transaction data for the session key normally, EIP-712 typed data for the owner above the approval threshold. The refusal condition for contract owners is a non-obvious failure mode that would otherwise surprise the agent. All of this is consistent with readOnlyHint=true and destructiveHint=false.

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?

Five tight sentences: purpose and destination first, then the "max" semantic, then the flow, then the approval exception, then the no-signing guarantee. No filler, and the most safety-relevant constraint is stated last for emphasis without burying the main action.

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?

There is no output schema, and the description compensates by describing both possible return shapes and when each occurs. With 100% schema coverage on six parameters including a nested approval object, nothing an agent needs to invoke the tool or interpret its result is missing.

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 a 3 baseline applies, but the description meaningfully upgrades it by defining "max" as stopping at the account's minimum ratio and by explaining the approval branch that produces the nonce/deadline/signature object. The market and account params are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: moving collateral from a position back to the account, with the destination constraint made explicit. It does not name the closest siblings (prepare_mandate_withdraw, prepare_mandate_owner_withdraw_collateral), so an agent must infer the distinction, but the scope statement is precise enough to separate it from deposit/repay/close tools.

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 clear operating conditions: "max" caps at the account's minimum ratio, limits are checked first, and the approval path only applies above the threshold. It also raises the exclusion that the approval route fails for contract owners (Safe), which steers the agent correctly. It stops short of explicitly contrasting with the sibling withdraw variants.

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