Skip to main content
Glama
kukapay

bsc-multisend-mcp

distributeNative

Send BNB to multiple BSC addresses in a single transaction using the C98MultiSend contract for bulk transfers.

Instructions

Send BNB to multiple addresses on BSC using the C98MultiSend contract.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.js:103-149 (registration)
    Registration of the 'distributeNative' tool using server.tool(), including inline schema and handler function.
    server.tool(
      'distributeNative',
      'Send BNB to multiple addresses on BSC using the C98MultiSend contract.',
      z.object({
        receivers: z.array(z.string().refine((val) => ethers.isAddress(val), {
          message: 'Invalid BSC address'
        })).describe('Array of BSC addresses to receive BNB.'),
        amounts: z.array(z.number().positive('Amount must be positive')).describe('Array of BNB amounts (in BNB, e.g., 0.1) to send to each receiver.')
      }),
      async ({ receivers, amounts }) => {
        try {
          // Validate inputs
          if (receivers.length !== amounts.length) {
            return {
              content: [{ type: 'text', text: 'Receivers and amounts arrays must have the same length' }],
              isError: true
            };
          }
    
          // Convert amounts to wei and calculate total
          const amountsWei = amounts.map(amount => ethers.parseEther(amount.toString()));
          const totalAmountWei = amountsWei.reduce((sum, amount) => sum + BigInt(amount), BigInt(0));
    
          // Prepare and send transaction
          const tx = await contract.transferMulti(receivers, amountsWei, {
            value: totalAmountWei,
            gasLimit: await contract.transferMulti.estimateGas(receivers, amountsWei, { value: totalAmountWei })
          });
    
          // Wait for transaction confirmation
          const receipt = await tx.wait();
    
          return {
            content: [{
              type: 'text',
              text: `BNB distribution successful. Tx Hash: ${receipt.hash}`
            }],
            isError: false
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error executing BNB distribution: ${error.message}` }],
            isError: true
          };
        }
      }
    );
  • Handler function that validates inputs, converts amounts to wei, calls contract.transferMulti to distribute BNB, and returns success or error response.
    async ({ receivers, amounts }) => {
      try {
        // Validate inputs
        if (receivers.length !== amounts.length) {
          return {
            content: [{ type: 'text', text: 'Receivers and amounts arrays must have the same length' }],
            isError: true
          };
        }
    
        // Convert amounts to wei and calculate total
        const amountsWei = amounts.map(amount => ethers.parseEther(amount.toString()));
        const totalAmountWei = amountsWei.reduce((sum, amount) => sum + BigInt(amount), BigInt(0));
    
        // Prepare and send transaction
        const tx = await contract.transferMulti(receivers, amountsWei, {
          value: totalAmountWei,
          gasLimit: await contract.transferMulti.estimateGas(receivers, amountsWei, { value: totalAmountWei })
        });
    
        // Wait for transaction confirmation
        const receipt = await tx.wait();
    
        return {
          content: [{
            type: 'text',
            text: `BNB distribution successful. Tx Hash: ${receipt.hash}`
          }],
          isError: false
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `Error executing BNB distribution: ${error.message}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters: arrays of receiver addresses and BNB amounts with validation.
    z.object({
      receivers: z.array(z.string().refine((val) => ethers.isAddress(val), {
        message: 'Invalid BSC address'
      })).describe('Array of BSC addresses to receive BNB.'),
      amounts: z.array(z.number().positive('Amount must be positive')).describe('Array of BNB amounts (in BNB, e.g., 0.1) to send to each receiver.')
    }),
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions using a specific contract ('C98MultiSend contract') but doesn't disclose critical behavioral traits like transaction costs, gas requirements, success/failure handling, security implications, or rate limits. For a financial transaction tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action and resource. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a financial transaction tool with no annotations and no output schema, the description is incomplete. It lacks details on return values, error handling, network conditions, or operational constraints. For a tool that sends cryptocurrency, this minimal description fails to provide adequate context for safe and effective use.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details beyond the schema, but since there are no parameters, this is appropriate. Baseline 4 is correct for zero-parameter tools where the schema fully covers the absence of inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send BNB'), target resource ('multiple addresses'), and context ('on BSC using the C98MultiSend contract'). It distinguishes from the sibling tool 'distributeToken' by specifying BNB instead of tokens, though it doesn't explicitly name the alternative. The purpose is specific and actionable.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'distributeToken'. The description implies usage for BNB distribution on BSC, but lacks explicit when/when-not criteria, prerequisites, or comparisons with sibling tools. It's a basic functional statement without usage context.

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/kukapay/bsc-multisend-mcp'

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