Skip to main content
Glama

Prepare: repay an agent credit line

credit_repay
Read-onlyIdempotent

Unsigned transactions repaying a line's USDG debt from the wallet (anyone may): an amount, or amount "all"; exact USDG approval to the line first (all: the debt plus a hundredth of a percent for interest until it lands; repay takes only what is owed). With close: true (a JSON boolean; the owner only): repay everything and take every credit and any USDG left back to the wallet. With unwind: true (a JSON boolean; the owner only; a line whose market has a pool): no USDG needed, the line sells its own CREDIT in its pool into the debt (sellAndRepay: by default enough to repay it all, at a minimum of the whole debt, then closes the line; sell and min_usdg to choose). Repaying, closing and an unwind at the whole debt work before CREDIT's price starts and during a write-off too. Check each transaction's to: a line the factory confirms (isAccount), or USDG for an exact approval.

Input Schema

NameRequiredDescriptionDefault
sellNoWith unwind: CREDIT to sell, or "all" (default: enough for the whole debt), in whole units as a decimal string, like "1.5"
closeNoThe owner: repay everything and take every credit back
amountNoUSDG to repay, or "all", in whole units as a decimal string, like "1.5"
unwindNoThe owner: sell the line's CREDIT into its debt, no USDG needed
walletYesThe wallet's address (0x...); the transactions are built for it to sign
accountYesThe line's address
min_usdgNoWith unwind: the least USDG the sale must bring (default: the whole debt when selling all or the default amount, else 97% of the pool's price), in whole units as a decimal string, like "1.5"
then_closeNoWith unwind: close the line after (default true when the sale covers the debt)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description reinforces that this only builds unsigned transactions ('Check each transaction's to:'). It adds genuinely extra behavior: exact USDG approval first, an interest buffer of a hundredth of a percent on 'all', repay taking only what is owed, owner-only gates, and sellAndRepay mechanics with its default minimums.

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?

The core purpose is front-loaded and nearly every clause carries operational detail rather than padding. Structure suffers from being one dense run-on paragraph with nested parentheticals, making the three modes harder to scan than a short mode-by-mode breakdown would be.

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 an eight-parameter, three-mode tool with no output schema, the description covers preconditions, permissions, defaults and failure-adjacent cases like write-offs. The only gap is that the returned structure (a list of unsigned transactions and their fields) is only implied by 'Unsigned transactions,' not spelled out.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the prose adds meaning the schema lacks: what 'all' resolves to (debt plus an interest buffer), that the repay transfers only the owed amount, that unwind needs no USDG and sells into the line's own pool at a minimum of the whole debt, and that sell/min_usdg/then_close override those defaults.

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?

The description leads with a specific verb and resource — it prepares unsigned transactions that repay a credit line's USDG debt — and names the three operational modes (plain repay, close, unwind). It never explicitly contrasts itself with close siblings like `repay` or `credit_pay`, so an agent must infer the distinction from the 'line's USDG debt' framing.

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?

It gives real selection criteria: 'anyone may' repay, close/unwind are 'the owner only', unwind requires 'a line whose market has a pool', and all modes work 'before CREDIT's price starts and during a write-off too.' It stops short of naming a sibling tool to use instead when these conditions fail.

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