Skip to main content
Glama

Prepare a deposit

prepare_deposit
Read-only

Build everything needed to deposit into MetaLend's rebalancer, without signing anything. For gasless tokens (USDC, MUSD, PYUSD) returns an EIP-712 ReceiveWithAuthorization typed-data payload — sign it with your own wallet and pass the signature to submit_deposit. For approval-only tokens (USDT, RLUSD, USDG, USDE) returns on-chain approve() parameters instead — your wallet must broadcast that approval itself (this server has no RPC access and cannot do it for you), then call submit_deposit with no signature. The signature flow only accepts a raw 65-byte EOA-style ECDSA signature — smart-contract wallets (including via ERC-6492 counterfactual deployment) are rejected regardless of validity, even for gasless-eligible tokens. A smart-contract wallet should instead pass method: "approval" explicitly here (works for any token, needs no signature at all) — but chain must then be one that wallet can actually transact on (see chain's own field description); this server cannot validate that. Requires a signed rebalancer config for this token already (use prepare_config/submit_config first if get_config shows none) — and validates the amount against the chain's minimum deposit — before returning anything, so a doomed request never reaches signing. A fixed on-behalf gas fee (see fee in the response, also available standalone via get_transaction_costs) is deducted from amount before the rebalancer credits it — the response's expectedCreditedAmountRaw is what will actually show up in get_balances after the deposit lands, not the full amount you send. Rate limited to 6 calls/minute per caller, no more than one call every 10s.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYesChain name, e.g. BASE, ETHEREUM, POLYGON — the originating chain of this deposit: where the approve() call is broadcast, or for the signature flow, the chain the EIP-712 signature must validate on. Not where the rebalancer later invests the funds — deposits are naturally cross-chain in that sense, and this server only checks that the token has a signed config at all (hasSignedConfig), independent of which chains that config's domainIds allow. For an EOA, this originating chain is supported unconditionally: a raw ECDSA signature has no chain-specific verification step of its own, so any chain works. But when it comes to deposits done on a chain the wallet doesn't have configuration for, the deposit might fail if it's a smart-contract wallet that doesn't support cross-chain signatures (e.g. Coinbase's Smart Wallet / Base Smart Wallet)
tokenYesToken symbol, e.g. USDC, USDT, MUSD, RLUSD, USDG, USDE, PYUSD.
amountYesRaw token amount as a decimal-digit string (smallest denomination). Use get_token_info for decimals.
methodNoForce a specific flow. Defaults to 'signature' for gasless-eligible tokens, else 'approval'.
walletAddressYesEVM wallet address (0x-prefixed, 40 hex chars). Any casing is accepted — it is normalized to its EIP-55 checksum before being forwarded upstream.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Even though annotations already declare readOnlyHint=true and destructiveHint=false, the description adds substantial behavioral context beyond them: the server has no RPC access and cannot broadcast approvals, smart-contract wallets (incl. ERC-6492) are rejected from the signature flow, a fixed on-behalf gas fee is deducted from amount, the server validates the signed-config prerequisite and minimum deposit before returning, and a 6 calls/minute rate limit applies. No contradiction with the annotations; rather, the description enriches the read-only semantics with concrete constraints.

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?

Every sentence earns its place—there is no filler and the core purpose is front-loaded. However, the content is delivered as one dense unbroken paragraph (~300 words), with the chain caveat partially duplicated between the description and the chain parameter schema. Given the tool's genuine complexity (two flows, wallet-type restrictions, fees, prerequsstes), the length is justified, but bullet-point structuring or paragraph breaks would improve scannability for an agent.

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?

For a tool with no output schema, the description steps up admirably: it describes what each flow returns (EIP-712 payload vs approve() params), names key response fields (fee, expectedCreditedAmountRaw), states preconditions (signed config, minimum deposit validation), covers rate limits, and explains the follow-up call (submit_deposit). An agent has everything needed to invoke it correctly and chain the result into the next step.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning far beyond the schema: it classifies tokens into gasless (USDC, MUSD, PYUSD) vs approval-only (USDT, RLUSD, USDG, USDE) groups, explains that the gas fee reduces the credited amount so expectedCreditedAmountRaw—not amount—is what appears in get_balances, and clarifies the chain parameter's cross-chain nuance and its irrelevance for EOA signatures. These interactions are critical for correct invocation and are absent from 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 opens with a specific verb-resource-scope statement: 'Build everything needed to deposit into MetaLend's rebalancer, without signing anything.' It clearly differentiates from sibling submit_deposit (which consumes the prepared payload) and prepare_withdrawal (opposite direction), and names the two distinct output artifacts (EIP-712 typed-data vs approve() parameters). An agent can tell exactly what this tool produces and what it does not do.

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 and routing guidance is abundant: it names prepare_config/submit_config as a prerequisite when get_config shows no signed config, directs the signature payload to submit_deposit, states that the wallet must broadcast the approval itself for approval-only tokens, instructs smart-contract wallets to pass method:'approval', and points to get_transaction_costs and get_balances for related needs. Nothing is left to inference.

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