Skip to main content
Glama

Prepare: Cash a loan out

gage_prepare_cash_out

Prepare cashing a running loan out: its whole collateral is sold through an aggregator, the loan repaid from the sale, and the rest less gage's 0.5% fee paid to the wallet, in one transaction. Returns the next unsigned transaction and a review link; never signs.

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": {
      "wallet": "<wallet>",
      "loanId": "<loanId>"
    },
    "name": "gage_prepare_cash_out"
  }
}

Input Schema

NameRequiredDescriptionDefault
engineNoThe engine; the current core when omitted, the loan's own core for a loan in a lend asset
loanIdYes
minNetNoThe least you accept to receive, raw units of the loan's asset (USDG: 6 decimals): the cash-out is refused under it, and its transaction reverts under it
walletYes
maxSlippageBpsNoMost the net you receive may fall below the quote, in bps of it; 50 when omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), and the description adds genuinely non-derivable facts: the 0.5% fee, the aggregator sale route, atomicity ('in one transaction'), and critically that it returns an unsigned transaction plus a review link and never signs. It still doesn't say whether the output needs a separate submit step or what happens on an unhealthy loan.

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?

Two sentences, zero filler, with the outcome (cash-out mechanics) front-loaded and the return/never-signs contract placed second. The fee, the aggregator, and the no-signing guarantee each earn their space.

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 mutation-preparing tool with no output schema, the description supplies the return shape, the fee, the atomic behavior, and the safety boundary, which is most of what an agent needs. Missing are the role of the engine override for lend-asset loans and any precondition checks (health, approvals) that would let the agent predict a revert.

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

Parameters2/5

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

The description names no parameters at all; loanId and wallet have no schema descriptions, and minNet/maxSlippageBps semantics live entirely in the schema. The mention of the 0.5% fee and net proceeds only loosely gestures at minNet, so the description does not compensate for the 60% coverage gap.

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 gives a specific verb+resource ('prepare cashing a running loan out') and then spells out the full mechanism: collateral sold through an aggregator, loan repaid from the sale, remainder minus a 0.5% fee sent to the wallet, all in one transaction. That mechanism is enough to separate it from siblings like gage_prepare_roll or gage_prepare_collect without opening their schemas.

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?

It implies usage by naming the precondition ('running loan') and describing the prepare-then-review flow, but there is no explicit when-to-use/when-not guidance and no contrast with alternatives such as gage_prepare_roll or gage_borrow_quote. An agent must infer that this is the closing path rather than a continuation path.

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