Skip to main content
Glama

prepare_marginfi_repay

DestructiveIdempotent

Repay outstanding debt in a MarginFi bank by building an unsigned transaction. Supports partial or full repayment via the repayAll flag.

Instructions

Build an unsigned MarginFi REPAY tx against outstanding debt in the named bank. Pass repayAll: true to repay the full outstanding debt (also clears the balance slot). DURABLE NONCE + prepare_marginfi_init prerequisites identical to prepare_marginfi_supply. BLIND-SIGN on Ledger.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesBase58 Solana mainnet address (ed25519 pubkey, 43 or 44 chars).
symbolNoCanonical token symbol (USDC, SOL, USDT, JUP, BONK, JTO, mSOL, jitoSOL). The builder resolves this to the underlying mint; MarginFi treats SOL as wSOL internally with auto-wrap/unwrap. Pass `mint` instead if your token isn't in the canonical list.
mintNoBase58 SPL mint address. Used as an override or when the token isn't in the canonical SOLANA_TOKENS table. Exactly one of `symbol` or `mint` must be passed.
accountIndexNoMarginfiAccount slot (0 = first, 1 = second, ...). Most users stay on 0. Use a different index to segregate positions across multiple MarginfiAccounts owned by the same wallet.
amountYesHuman-readable decimal amount to repay against outstanding debt in this bank.
repayAllNoSet true to repay the full outstanding debt in this bank (SDK also clears the balance slot — cheaper for the user if they're closing out). Omit for partial.
Behavior4/5

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

Beyond annotations, the description adds behavioral context: it builds an unsigned transaction (not executing it), mentions clearing the balance slot on repayAll, and notes blind-sign on Ledger. This complements the annotations without contradiction.

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?

The description is very concise: two sentences plus essential notes on prerequisites and blind-sign. It is front-loaded with the core purpose and contains no redundant information.

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

Completeness3/5

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

The description covers key aspects like prerequisites and special behavior, but it does not describe the return value (expected to be an unsigned transaction object). Since there is no output schema, this omission leaves some ambiguity for agents unfamiliar with the tool family.

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?

The description adds meaning beyond the schema by clarifying that `repayAll` clears the balance slot, that `symbol` resolves to mint with internal SOL handling, and that exactly one of `symbol` or `mint` is required. This adds value beyond the schema's descriptions.

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 clearly states the tool's purpose with a specific verb ('Build an unsigned MarginFi REPAY tx') and resource ('outstanding debt in the named bank'). It distinguishes from siblings like prepare_marginfi_borrow and prepare_marginfi_supply by referencing prerequisites and the specific repay action.

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?

The description provides explicit guidance for the `repayAll` parameter and mentions prerequisites (durable nonce and init steps) referencing a sibling tool. However, it does not explicitly state when not to use the tool or specify alternatives for scenarios where there is no debt.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/szhygulin/vaultpilot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server