Skip to main content
Glama

Prepare close and redeem

prepare_close_and_redeem
Read-onlyIdempotent

After settlement: withdrawResidual (closes the sponsor position and pays the residual), redeem the wallet's synth if redemption is open, or claim a top-up. Returns UNSIGNED transaction data (to, data, value, gas) for the user's own wallet; simulated against the latest block first and refused if it would revert. Never signs or sends.

Input Schema

NameRequiredDescriptionDefault
ownerYesThe user's wallet address (0x...). Used to read the position and as the simulated sender; nothing is signed.
marketYesMarket address (0x...) or symbol, e.g. NO-NVDA

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real value beyond them: returns UNSIGNED transaction data, simulates against the latest block, refuses if it would revert, and never signs or sends. This resolves the apparent tension between a mutating-sounding name and readOnlyHint=true. It stops short of describing failure payloads or what happens on simulation refusal.

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?

A single dense sentence with the precondition front-loaded and every clause carrying information: the branches, the return shape, the simulation guard, and the no-signing guarantee. No filler.

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?

No output schema exists, and the description compensates by naming the return fields (to, data, value, gas). Combined with the simulation and refusal behavior, an agent has everything needed to call and interpret this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both parameters (owner, market) are already documented including the symbol-or-address flexibility. The description adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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 specific operations (withdrawResidual, redeem synth, claim top-up) and the resource (post-settlement position/wallet). It distinguishes itself implicitly by saying the tx is for "the user's own wallet," implying the prepare_mandate_* siblings cover delegated variants, but never names them explicitly.

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?

"After settlement" gives a clear triggering condition, and the enumerated branches (withdrawResidual / redeem if open / claim top-up) tell the agent which case applies. It does not explicitly exclude or name the alternative prepare_mandate_close_and_redeem, so routing between the two requires inference.

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