Skip to main content
Glama

Build Equity Vault Exit

build_equity_exit_tx

Build the UNSIGNED call batch to fully unwind an OPEN equity vault (from get_positions.equityPositions): close each of its yield loops, then one self-funded router call repays the stock debt, withdraws the stock, swaps it to USDG and returns the proceeds. Submit as ONE atomic batch. Non-custodial; the vault's yield loop cannot be closed alone through build_manage_tx. Only the vault's own loop(s) are closed: those get_positions attributes unambiguously, or exactly the ones you pass in yieldPositionIds. Always read meta.closedYieldPositionIds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdNoChain to target. Supported: 1, 4663. Default: 1.
slippageNoSwap slippage ratio. Default 0.01, capped at 0.01.
strategyIdYesThe vault's id ('equity-0x…').
userAddressYesWallet that owns the vault and will sign.
yieldPositionIdsNoThe yield loop id(s) to close with the stock leg (from get_positions). Optional when the vault's yieldLoopMatch is tagged/basis/mixed; REQUIRED when it is 'ambiguous'. Nothing outside this list is closed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / yieldPositionIds
      Added value: +{
      +  "description": "The yield loop id(s) to close with the stock leg (from get_positions). Optional when the vault's yieldLoopMatch is tagged/basis/mixed; REQUIRED when it is 'ambiguous'. Nothing outside this list is closed.",
      +  "items": {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "type": "array"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give readOnlyHint=false and destructiveHint=false, so the description adds substantial behavioral context: the batch is unsigned, non-custodial, must be submitted atomically, and only the vault's own loops are closed. It also discloses the internal router actions and the meta field requirement, far exceeding annotation coverage.

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?

Three dense sentences with no fluff. The primary action is front-loaded, the alternative is named, and critical constraints (atomic, non-custodial, meta field) are packed in efficiently. Every clause earns its place.

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?

For a complex builder tool with no output schema, it explains the core process, the atomic submission requirement, and hints at the response via meta.closedYieldPositionIds. It doesn't fully describe the return structure or error cases, but gives enough for an agent to call and handle the result correctly in most scenarios.

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 coverage is 100%, and the schema already documents each parameter, including the optional/required rule for yieldPositionIds and 'Nothing outside this list is closed.' The description mainly restates these details without adding new parameter-level meaning, so the baseline of 3 is appropriate.

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 states a specific action ('Build the UNSIGNED call batch to fully unwind an OPEN equity vault') and the exact mechanism (close yield loops, router call, repay, withdraw, swap). It differentiates from build_manage_tx by noting the yield loop cannot be closed alone through that sibling.

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?

Provides clear context: use for full unwind of an open equity vault, and explicitly excludes build_manage_tx as an alternative for closing the loop. Also explains the optional/required behavior of yieldPositionIds and instructs to always read meta.closedYieldPositionIds.

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.