Skip to main content
Glama

Prepare a Yield Copilot vault withdraw (Morpho USDC on Base) as an unsigned swap pair

otto_prepare_yield_withdraw
Read-only

Prepare the EXACT otto_prepare_swap pair (envelope + prepareInput) that redeems vault shares from one of the executable Morpho vaults in the Yield Copilot registry back to USDC in the signing account, as a LI.FI exit route (which may sell shares or compose a protocol redemption) whose input token is the vault's ERC-4626 share token. The vault and the asset come from the registry row named by executableMarketId and are never inputs; the caller's registryCommitment must equal the commitment recomputed over the current record. The quoted USDC is checked against the vault's own previewRedeem and refused when it falls short by more than the pinned tolerance. Returns the pair unchanged plus a preview; never signs or submits; the signing account signs and sends the pair itself. Preparation does not authorize execution. Every envelope from this server is valid for 300 seconds from construction (valid_until); a stale envelope is refused by the verifier — request a fresh one.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "accountProfile": "<accountProfile>",
      "executableMarketId": "<executableMarketId>",
      "registryCommitment": "<registryCommitment>",
      "shares": "<shares>",
      "slippage": "<slippage>"
    },
    "name": "otto_prepare_yield_withdraw"
  }
}

Input Schema

NameRequiredDescriptionDefault
sharesYes
slippageYes
client_refNo
accountProfileYes
executableMarketIdYes
registryCommitmentYes

Output Schema

NameRequiredDescriptionDefault
previewYes
envelopeYes
prepareInputYes
registry_commitmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / preview / properties / route_semantics
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "action": {
      +      "enum": [
      +        "deposit",
      +        "withdraw"
      +      ],
      +      "type": "string"
      +    },
      +    "classification": {
      +      "enum": [
      +        "share-purchase",
      +        "share-sale",
      +        "protocol-composition",
      +        "mixed",
      +        "unclassified"
      +      ],
      +      "type": "string"
      +    },
      +    "evidence": {
      +      "const": "provider-quote-steps",
      +      "type": "string"
      +    },
      +    "protocol_action_verified": {
      +      "const": false,
      +      "type": "boolean"
      +    },
      +    "tools": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "transport": {
      +      "const": "lifi",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "transport",
      +    "action",
      +    "classification",
      +    "evidence",
      +    "protocol_action_verified",
      +    "tools"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / properties / preview / required
      Previous value: -[
      -  "market_id",
      -  "venue",
      -  "protocol",
      -  "chain_id",
      -  "vault",
      -  "asset",
      -  "shares",
      -  "expected_assets",
      -  "min_assets",
      -  "preview_redeem_assets",
      -  "parity_shortfall_bps",
      -  "parity_tolerance_bps",
      -  "quoted_fees"
      -]New value: +[
      +  "market_id",
      +  "venue",
      +  "protocol",
      +  "chain_id",
      +  "vault",
      +  "asset",
      +  "shares",
      +  "expected_assets",
      +  "min_assets",
      +  "preview_redeem_assets",
      +  "parity_shortfall_bps",
      +  "parity_tolerance_bps",
      +  "quoted_fees",
      +  "route_semantics"
      +]
  2. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it says the tool never signs or submits, that preparation does not authorize execution, that every envelope is valid for 300 seconds and is refused when stale by the verifier, that quoted USDC is cross-checked against the vault's previewRedeem with a pinned tolerance, and that the pair is returned unchanged with a preview. These are exactly the failure modes an agent needs to know about.

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?

Front-loaded with the purpose before the caveats, and nearly every clause carries information (registry derivation, previewRedeem check, 300-second validity). It loses a little to the very long first sentence with stacked parentheticals and to the near-repetition of 'never signs or submits' followed by 'the signing account signs and sends the pair itself'.

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 non-trivial 6-parameter preparation tool with five required fields and a nested accountProfile, the description covers the dangerous edges: derived vault/asset, commitment verification, slippage tolerance, envelope expiry, and no submission. Since an output schema exists, the return value needs no further explanation; only error/refusal specifics are absent.

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 0%, so the description carries the burden. It clarifies executableMarketId (a registry row name), registryCommitment (must match the commitment recomputed over the current record) and, implicitly, that the vault and asset are derived rather than passed. It says nothing about accountProfile, client_ref, or the units/format of shares and slippage.maxBps, so the compensation is partial.

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 names a specific verb (Prepare), a specific resource (a vault-share-to-USDC redeem route) and a specific output shape (the otto_prepare_swap envelope + prepareInput pair). It also pins the venue (Morpho vaults in the Yield Copilot registry, Base, USDC), which separates it cleanly from otto_prepare_swap and otto_prepare_yield_deposit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicit context is there: this is the withdrawal direction for registry-listed Morpho vaults, with explicit preconditions (executableMarketId must name an executable registry row; registryCommitment must equal the recomputed commitment). However, it never states when to pick this over otto_prepare_swap directly or what to do when the registry commitment mismatches, so the routing decision is left to 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