Skip to main content
Glama

Prepare a buyback

build_buyback
Read-onlyIdempotent

Returns the unsigned transactions to pay back a loan and get collateral back: a USDC approval (only if needed) then buyback. Omit payment_usdc to pay the full remaining amount.

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": {
      "loan_id": "<loan_id>",
      "borrower": "<borrower>"
    },
    "name": "build_buyback"
  }
}

Input Schema

NameRequiredDescriptionDefault
loan_idYesLoan ID
borrowerYesBorrower wallet that will sign; must be the wallet that opened the loan
payment_usdcNoUSDC to pay. Omit to pay everything left and get all collateral back

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / borrower / description
      Added value: +"Borrower wallet that will sign; must be the wallet that opened the loan"
    • addedInput schema / properties / payment_usdc / description
      Added value: +"USDC to pay. Omit to pay everything left and get all collateral back"
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description adds genuinely new context: it returns unsigned (not executed) transactions, the approval step is conditional ('only if needed'), and the output is ordered approval-then-buyback. It does not cover failure conditions or what happens when the loan is already repaid.

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 front-loaded sentence with a colon-delimited breakdown of the returned transactions. Every clause earns its place, and the conditional approval caveat is placed where it matters.

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?

With no output schema, the description carries the burden of explaining the return value, and it does so at a high level (unsigned transactions, ordered approval then buyback). Minor gaps remain: the exact shape/count of the returned transaction array and any error or precondition behavior are unstated, but an agent has enough to call and consume it correctly.

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%, so loan_id, borrower and payment_usdc are already fully documented, including the omission semantics. The description restates the payment_usdc omission rule rather than adding new meaning. Baseline 3 is appropriate since the schema carries the load.

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 concrete verb and result: 'Returns the unsigned transactions to pay back a loan and get collateral back', and clarifies the protocol-specific term 'buyback' in plain language. It also names the composition of the result (approval then buyback), which distinguishes it from sibling builders like build_borrow or build_claim_collateral, though it never explicitly contrasts with them.

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?

Usage is implied rather than stated: 'Returns the unsigned transactions' signals a prepare-then-sign step, and the note about omitting payment_usdc gives one conditional behavior. There is no explicit when-to-use vs when-not guidance and no mention of alternatives such as build_claim_collateral for the post-repayment case.

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.