Skip to main content
Glama

prepare_marginfi_supply

DestructiveIdempotent

Build an unsigned transaction to supply tokens into a MarginfiAccount, earning the bank's supply APY. Requires prior account initialization and durable nonce.

Instructions

Build an unsigned MarginFi SUPPLY tx for a given bank (by symbol or mint). Supplies the specified amount of the underlying token into the user's MarginfiAccount position in that bank, earning the bank's supply APY. DURABLE NONCE REQUIRED + prepare_marginfi_init must have run first; otherwise this tool errors. Pre-flight: bank-pause check; invalid-mint check (MarginFi only lists a subset of SPL tokens). Uses v0 VersionedTransaction + MarginFi group ALTs for compact wire size. BLIND-SIGN on Ledger — match the Message Hash on-device after preview_solana_send.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesSolana wallet executing the supply. Must have an initialized MarginfiAccount (run prepare_marginfi_init first) AND a durable-nonce account (prepare_solana_nonce_init).
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 supply (e.g. "1.5" for 1.5 USDC). Decimals resolved from the bank's mint — do NOT pass raw base units.
Behavior5/5

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

The description reveals key behavioral details: it builds v0 VersionedTransactions with ALTs for compact wire size, requires blind-sign on Ledger, performs auto-wrap of SOL to wSOL, and mentions the need to match Message Hash on-device after preview_solana_send. Annotations indicate destructiveHint=true and readOnlyHint=false, which align with the description. No contradictions.

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 description is dense and structured: first sentence states core purpose, then prerequisites in caps, then pre-flight checks, then technical details. Every sentence adds value, though it could be slightly shorter without losing content.

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?

Given no output schema, the description explains core behavior (unsigned tx, blind-sign), prerequisites, and checks. It omits the exact return format (likely base64 transaction), but the steps for signing and sending are implied. Overall sufficient for an agent to use correctly.

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 input schema has 100% coverage, and the description adds meaning beyond the schema: for 'symbol' it lists canonical tokens and notes SOL-to-wSOL handling; for 'mint' it clarifies override use; for 'amount' it emphasizes human-readable format; for 'accountIndex' it explains segregation. This adds value without redundancy.

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 explicitly states the tool builds an unsigned MarginFi SUPPLY transaction for a given bank, specifying the action (supply), the protocol (MarginFi), and the resource (bank by symbol or mint). It clearly distinguishes from siblings like prepare_marginfi_withdraw or prepare_marginfi_borrow.

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 clear prerequisites (durable nonce required, prepare_marginfi_init must have run) and pre-flight checks (bank-pause, invalid-mint). It also explains when to use symbol vs mint. However, it does not explicitly contrast with alternative protocols like Kamino or Compound, though the context of sibling tools mitigates this.

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