Skip to main content
Glama

lend_deposit

Destructive

Deposit assets to earn yield on Kamino or Marginfi (non-custodial).

Returns an UNSIGNED base64 tx to sign + broadcast, plus supply APY. amount is in base units of token. protocol: kamino | marginfi -- pin one to keep exact prior behaviour. Marginfi needs marginfi_account (create via the sidecar). Past the daily free tier an x402 payment_header is required. The deposited token is authenticity-verified first; set allow_unverified=true to supply an unverified token at own risk.

venue_hint / auto-route: pass protocol="auto" (or "") -- optionally with venue_hint as an advisory alias, same naming as jupiter_swap/trade_equity -- to route through the SAME primary+fallback health-failover the earn/lending trade bridge already applies: an empty rate snapshot on the primary protocol fails over to the configured fallback. Extends this tool instead of adding a separate earn_quote/trade_earn surface, so lend_deposit is now the one first-class MCP path for both a pinned protocol and an auto-routed deposit. A router-resolved call also carries the smart-contract counterparty-risk disclosure in the response (disclosures), matching that bridge.

Workflow: EXECUTE step (yield leg) -- supply idle stables/tokens after comparing get_lending_rates; monitor with get_health_factor. See get_trading_workflow.

idempotency_key (optional): a client-generated UUID. Retrying with the same key + same args replays the original result instead of re-depositing. Reuse the SAME key across the build call and its signed_transaction completion call -- the two legs dedupe independently, so this never raises IDEMPOTENCY_CONFLICT; a NEW key means a genuinely new deposit.

signed_transaction / verify (two-phase execution): re-call this tool with the SIGNED base64 tx and Crank broadcasts it, then awaits on-chain confirmation and re-reads BOTH the deposited token's balance and the obligation's health -- the response carries a real verification block ({confirmed, slot, post_state, expected_vs_actual}). Gate follow-on borrowing on verification.confirmed, never on tx_signature alone. verify=false skips only the confirmation wait. When the build leg auto-routed (protocol="auto"), pass back the SAME resolved protocol the build response reported -- re-resolving from "auto"/ venue_hint again on the completion leg could pick a different venue if health changed between calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYes
amountYes
marketNo
verifyNo
protocolYes
caller_idNo
venue_hintNo
pay_in_crankNo
payment_headerNo
wallet_addressYes
idempotency_keyNo
allow_unverifiedNo
marginfi_accountNo
signed_transactionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / venue_hint
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / signed_transaction
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / verify
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Far exceeds the annotations: it discloses that the build leg returns an UNSIGNED base64 tx plus supply APY, describes the two-phase signed_transaction completion, idempotency_key replay semantics, x402 payment_header requirements beyond the free tier, token authenticity verification with allow_unverified risk, and health-failover behavior. Annotations (destructive/openWorld) are consistent with this and the description adds substantial operational context on top.

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-loaded with the purpose and well-sectioned (Workflow, venue_hint/auto-route, idempotency_key, signed_transaction/verify). It is long, and some meta-commentary about extending the tool rather than adding an earn_quote surface is API-design rationale rather than agent-facing guidance, but most sentences carry real operational weight.

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 a 14-parameter, 0%-coverage mutation tool it covers the critical mechanics: routing, idempotency, two-phase execution, payment gating, and the verification block it returns. The undocumented market, caller_id, and pay_in_crank parameters are the remaining incompleteness, though an output schema exists so return values need not be detailed.

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?

With 0% schema description coverage and 14 parameters, the description carries the burden and does well for the non-obvious ones: amount units ('base units of token'), protocol values (kamino|marginfi|auto|""), marginfi_account source, payment_header/x402, allow_unverified, venue_hint, idempotency_key, signed_transaction, and verify. However, market, caller_id, pay_in_crank, and the token/wallet_address formats are never explained, leaving a meaningful gap.

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 opening line names a specific verb and resource ('Deposit assets to earn yield on Kamino or Marginfi') and immediately scopes it as non-custodial. It distinguishes itself from siblings by naming get_lending_rates (pre-check), get_health_factor (monitoring), and lend_borrow/lend_repay, so an agent can place it in the workflow without opening other schemas.

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?

Explicit when-to-use: 'EXECUTE step (yield leg) -- supply idle stables/tokens after comparing get_lending_rates; monitor with get_health_factor.' It also routes between modes (pinned protocol vs protocol='auto') and names get_trading_workflow as the orchestration reference.

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