Skip to main content
Glama

sui-transfer

Transfer SUI tokens (in mist) to one or multiple wallet addresses on Sui blockchain networks, including mainnet, testnet, devnet, and localnet.

Instructions

transfer SUI(in mist) to single or multiple addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountsYes
networkNomainnet
recipientsYes

Implementation Reference

  • The main execution handler for the 'sui-transfer' tool. Processes input parameters, retrieves sender keypair, creates SuiClient, calls batchTransferSUI helper, and returns success/failure response with transaction digest.
    async cb(args: TransferParams) {
      const network = args.network as SuiNetwork;
      const amounts = args.amounts.map((amount: number) => BigInt(amount));
      const recipients = args.recipients;
    
      if (!config.sui.privateKey) throw new Error('Missing private key, please set it in config');
      const sender = getKeypairFromPrivateKey(config.sui.privateKey) as Keypair;
      if (!sender) throw new Error('Invalid private key, please check your config');
    
      const suiClient = new SuiClient({ url: getFullnodeUrl(network) });
    
      let digest = '';
      let errMsg = '';
      try {
        digest = await batchTransferSUI(amounts, recipients, sender, suiClient);
      } catch (error) {
        errMsg = error as string;
      }
    
      return this.createTextResponse(
        `Transfer ${digest ? 'successful' : 'failed'}: digest: '${digest}', error: '${errMsg}'`
      );
    }
  • Zod input schema for the tool parameters (network, amounts in mist as numbers, recipient addresses) and its assignment to the tool's paramsSchema.
    const transferParamsSchema = z.object({
      network: z.enum(SUI_NETWORKS).default('mainnet'),
      amounts: z.array(z.number()).nonempty(),
      recipients: z.array(z.string()).nonempty(),
    });
    
    type TransferParams = z.output<typeof transferParamsSchema>;
    
    export class SuiTransferTool extends BaseTool<TransferParams> {
      name = 'sui-transfer';
      description = 'transfer SUI(in mist) to single or multiple addresses';
      paramsSchema = transferParamsSchema;
  • Central registration file that imports the suiTransferTool instance from transfer.ts and includes it in the exported array of all MCP tools.
    import faucetTool from './sui/get-faucet.js';
    import suiBalanceTool from './sui/get-balance.js';
    import suiTransferTool from './sui/transfer.js';
    import randomSuiAccountTool from './account/gen-random.js';
    import genMnemonicTool from './account/gen-mnemonic.js';
    import genSuiAccountsByMnemonicTool from './account/gen-by-mnemonic.js';
    import getAccountInfoByPriKeyTool from './account/get-info-by-pri-key.js';
    
    export default [
      faucetTool,
      suiBalanceTool,
      suiTransferTool,
      randomSuiAccountTool,
      genMnemonicTool,
      genSuiAccountsByMnemonicTool,
      getAccountInfoByPriKeyTool,
    ];
  • Core helper utility function that implements batch SUI transfers: validates inputs, checks balance, builds programmable transaction block to split and transfer coins, signs, executes, and confirms the transaction.
    export async function batchTransferSUI(
      amounts: bigint[],
      recipients: string[],
      sender: Keypair,
      client: SuiClient
    ): Promise<string> {
      if (amounts.length !== recipients.length)
        throw new Error('Amounts and recipients must have the same length');
    
      // Amount must be greater than 0
      if (amounts.some(amount => amount <= BigInt(0))) throw new Error('Amount must be greater than 0');
    
      // Invalid recipient address
      if (recipients.some(recipient => !isValidSuiAddress(recipient))) {
        throw new Error('Invalid recipient address');
      }
    
      const sumAmountsInMist = amounts.reduce((acc, amount) => acc + amount, 0n);
    
      const senderAddress = sender.toSuiAddress();
    
      const senderBalance = await getBalanceInMist(senderAddress, client);
      if (senderBalance === null) throw new Error('Failed to get balance');
    
      if (senderBalance <= sumAmountsInMist)
        throw new Error(`Insufficient balance: ${senderAddress}, balance: ${senderBalance}`);
    
      // Create new transaction
      const tx = new Transaction();
    
      // Split coins from gas coin
      const splitCoins = tx.splitCoins(tx.gas, amounts);
    
      // Transfer each split coin to corresponding recipient
      recipients.forEach((recipient, i) => {
        tx.transferObjects([splitCoins[i]], recipient);
      });
    
      // Set transaction sender
      tx.setSender(senderAddress);
    
      // Sign and execute transaction
      const { digest } = await client.signAndExecuteTransaction({
        transaction: tx,
        signer: sender,
        requestType: 'WaitForLocalExecution',
      });
    
      // Wait for transaction to be confirmed
      await client.waitForTransaction({
        digest: digest,
      });
    
      return digest;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'transfer SUI' which implies a write/mutation operation, but doesn't mention critical behaviors like transaction fees, irreversible nature, required permissions (e.g., private key), rate limits, or error handling. This is a significant gap for a financial tool.

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 extremely concise at one sentence with zero wasted words, front-loading the core action. It efficiently conveys the basic purpose without unnecessary elaboration.

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?

For a financial transfer tool with 3 parameters (0% schema coverage), no annotations, and no output schema, the description is incomplete. It lacks details on behavior (e.g., transaction confirmation), parameter usage, error cases, and output format, making it inadequate for safe and effective use by an AI agent.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but fails to do so. It mentions 'amounts' and 'recipients' implicitly via 'transfer...to addresses', but doesn't explain parameter meanings (e.g., amounts in mist, recipients as addresses), relationships (arrays must match), or the optional 'network' parameter with its enum values. This leaves key semantics undocumented.

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 verb 'transfer' and resource 'SUI(in mist)' with scope 'to single or multiple addresses', which is specific and actionable. However, it doesn't distinguish this from potential sibling tools like 'faucet' (which might give SUI) or 'sui-balance' (which checks SUI), so it lacks explicit differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing SUI balance), exclusions (e.g., not for testing), or comparisons to siblings like 'faucet' for obtaining SUI or 'sui-balance' for checking funds.

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

Related 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/deanpluse/sui-mcp'

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