Skip to main content
Glama

Prepare a Loan Repayment

prepare_repay_loan_calldata

Builds an unsigned transaction blueprint for repaying a Gavel loan, including the prerequisite approval for the repayment amount.

Validates that the loan is live and that you are its borrower. Repay before maturity or the lender may claim your collateral.

The repayment is transferred directly to the current holder of the lender position. On a USDC loan it reverts if USDC refuses that holder or is paused (known issue KI-3); the blueprint then carries a warning saying so.

Returns an unsigned transaction blueprint for the requested intent. The user is responsible for reviewing, signing, and broadcasting via their own wallet. Aletheia does not hold keys or dispatch transactions.

Input Schema

NameRequiredDescriptionDefault
loan_idYesThe loan to repay. See get_user_positions.
networkNoNetwork. Default 'arbitrum-one' (mainnet, real funds).arbitrum-one
borrower_addressYesYour address — must match the loan's borrower.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses validation logic (loan live, borrower match), the direct-transfer routing to the current lender-position holder, a named failure mode with warning behavior for USDC loans (KI-3), and the custody posture (user signs/broadcasts, Aletheia holds no keys). This is unusually rich behavioral disclosure for a mutation tool.

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-loads the core action, then separates validation, failure-mode, and return/custody notes into discrete paragraphs. It is slightly longer than strictly necessary but every sentence conveys distinct, useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description explains what is returned (an unsigned transaction blueprint for the requested intent) and the division of responsibility for signing/broadcasting. Combined with the disclosed failure mode and validation, an agent has everything needed to call and interpret this tool.

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 the schema already documents loan_id, network, and borrower_address, including the borrower-match constraint and default network. The description adds no syntax or format detail beyond the schema, so the baseline of 3 applies.

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?

States a specific verb and resource ('Builds an unsigned transaction blueprint for repaying a Gavel loan') with the added scope of the bundled approval step. This clearly distinguishes it from sibling prepare_* tools like prepare_bid_calldata and prepare_claim_collateral_calldata.

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?

Gives clear operating context: it validates the loan is live and that you are the borrower, and it warns to repay before maturity or risk collateral claim. It does not explicitly contrast when to pick this over the other prepare_* siblings, but the conditions for use are unambiguous.

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.