Skip to main content
Glama
lordbasilaiassistant-sudo

base-multi-wallet-mcp

fund_wallets

Distribute ETH equally across multiple managed wallets to prepare them for coordinated trading operations on Base network.

Instructions

Send ETH from main wallet (DEPLOYER_PRIVATE_KEY) to all managed wallets equally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
total_eth_amountYesTotal ETH to distribute equally across all managed wallets (e.g. '0.01')

Implementation Reference

  • The main handler function for the `fund_wallets` tool. It splits the total ETH amount across managed wallets and initiates transactions from the main wallet.
    async function handleFundWallets(
      args: z.infer<typeof FundWalletsSchema>
    ): Promise<string> {
      if (wallets.length === 0) {
        return JSON.stringify({
          success: false,
          error: "No managed wallets to fund. Create or import wallets first.",
        });
      }
    
      const mainWallet = getMainWallet();
      const totalWei = ethers.parseEther(args.total_eth_amount);
      const perWalletWei = totalWei / BigInt(wallets.length);
    
      if (perWalletWei === 0n) {
        return JSON.stringify({
          success: false,
          error: "Amount too small to split across wallets",
        });
      }
    
      // Check main wallet balance
      const mainBalance = await mainWallet.provider!.getBalance(mainWallet.address);
      const gasBuffer = 21_000n * 3n * BigInt(wallets.length); // rough gas buffer
      const feeData = await mainWallet.provider!.getFeeData();
      const gasPrice = feeData.gasPrice ?? 0n;
      const totalGas = gasBuffer * gasPrice;
    
      if (mainBalance < totalWei + totalGas) {
        return JSON.stringify({
          success: false,
          error: `Insufficient balance. Need ~${formatEth(totalWei + totalGas)} ETH, have ${formatEth(mainBalance)} ETH`,
        });
      }
    
      // Get starting nonce
      let nonce = await mainWallet.getNonce();
    
      // Send transfers in parallel with sequential nonces
      const txPromises = wallets.map((w, i) => {
        const currentNonce = nonce + i;
        return mainWallet
          .sendTransaction({
            to: w.address,
            value: perWalletWei,
            nonce: currentNonce,
            gasLimit: 21_000n,
          })
          .then(async (tx) => {
            const receipt = await tx.wait();
            return {
              address: w.address,
              label: w.label,
              amount: formatEth(perWalletWei),
              txHash: tx.hash,
              success: receipt !== null && receipt.status === 1,
            };
          })
          .catch((err: unknown) => ({
            address: w.address,
            label: w.label,
            amount: formatEth(perWalletWei),
            txHash: "",
            success: false,
            error: err instanceof Error ? err.message : String(err),
          }));
      });
    
      const results = await Promise.allSettled(txPromises);
      const outcomes = results.map((r) =>
        r.status === "fulfilled" ? r.value : { success: false, error: "Promise rejected" }
      );
    
      const succeeded = outcomes.filter((o) => o.success).length;
    
      return JSON.stringify(
        {
          success: succeeded > 0,
          funded: succeeded,
  • Input schema for the `fund_wallets` tool, defining the `total_eth_amount` argument.
    const FundWalletsSchema = z.object({
      total_eth_amount: z
        .string()
        .describe("Total ETH to distribute equally across all managed wallets (e.g. '0.01')"),
    });
  • src/index.ts:808-821 (registration)
    The definition of the `fund_wallets` tool in the MCP tools array, providing its name, description, and input schema.
    {
      name: "fund_wallets",
      description:
        "Send ETH from main wallet (DEPLOYER_PRIVATE_KEY) to all managed wallets equally.",
      inputSchema: {
        type: "object" as const,
        properties: {
          total_eth_amount: {
            type: "string",
            description:
              "Total ETH to distribute equally across all managed wallets (e.g. '0.01')",
          },
        },
        required: ["total_eth_amount"],
Behavior3/5

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

Without annotations, the description carries the burden of behavioral disclosure. It successfully identifies the source wallet (DEPLOYER_PRIVATE_KEY) and equal distribution logic, but fails to mention transaction costs, irreversibility, or what happens if the main wallet has insufficient funds.

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?

Single sentence with zero waste. Information is front-loaded with the action (Send ETH) followed by critical qualifiers (source, destination, method). Every word earns its place.

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?

For a single-parameter financial transaction tool with no output schema, the description adequately covers the core operation but omits expected return values (transaction hash), error conditions, or gas fee implications that would help an agent handle the response.

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

Parameters3/5

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

With 100% schema description coverage, the parameter total_eth_amount is fully documented in the schema itself. The description reinforces the 'equal' distribution aspect but adds no additional parameter syntax, validation rules, or format details 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 the action (Send ETH), source (main wallet/DEPLOYER_PRIVATE_KEY), destination (all managed wallets), and distribution method (equally). It effectively distinguishes from sibling tools like collect_funds (which likely reverses the flow) and create_wallet (which creates rather than funds).

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

Usage Guidelines3/5

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

The description implies prerequisites (managed wallets must exist, DEPLOYER_PRIVATE_KEY must be configured) but does not explicitly state when to use this versus collect_funds or coordinated_buy. No explicit 'when-not' guidance is provided.

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/lordbasilaiassistant-sudo/base-multi-wallet-mcp'

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