Skip to main content
Glama

prepare_marginfi_supply

DestructiveIdempotent

Deposits tokens into a MarginFi lending pool by constructing an unsigned transaction for blind-signing on Ledger, earning supply APY.

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?

Annotations indicate destructive and idempotent. Description adds technical details: uses v0 VersionedTransaction, MarginFi group ALTs for compact wire size, and blind-sign on Ledger. No contradiction with annotations. This goes beyond annotations to warn about ledger signing and transaction type.

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?

Description is a single paragraph that efficiently covers purpose, prerequisites, technical details, and parameter hints. Every sentence is informative without redundancy. Front-loaded with the core action.

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?

Given the complexity (5 params, no output schema), the description covers all necessary aspects: prerequisites, usage conditions, technical behavior, parameter semantics, and ledger interaction. It is complete for an agent to invoke correctly.

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

Parameters5/5

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

All 5 parameters have schema descriptions (100% coverage). Description adds context: wallet must have initialized MarginfiAccount and nonce; symbol lists canonical tokens and explains SOL/wSOL handling; mint explains override; accountIndex explains position segregation; amount clarifies human-readable format and decimal resolution. This adds significant value beyond the schema.

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 it builds an unsigned MarginFi SUPPLY transaction for a given bank, specifying the action, resource, and outcome. It distinguishes from sibling tools like prepare_marginfi_borrow and prepare_marginfi_withdraw by focusing on supply and mentioning earning supply APY.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states prerequisites: durable nonce required and prepare_marginfi_init must run first. Provides pre-flight checks and guidance on when to use symbol vs mint. Includes blind-signing instructions, which helps the agent avoid errors.

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/recon-crypto-mcp'

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