Skip to main content
Glama

transferNativeToken

Transfer BNB tokens between addresses securely on Binance Smart Chain through the BSC MCP Server. Specify recipient and amount for direct native token transactions.

Instructions

Transfer native token (BNB)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYes
recipientAddressYes

Implementation Reference

  • Handler function that sends native token (BNB) transaction using walletClient.sendTransaction to the recipient address with parsed amount, handles success and error responses with transaction URLs.
    async ({ recipientAddress, amount }) => {
      let txHash = undefined;
      try {
    
        const account = await getAccount();
        txHash = await walletClient(account).sendTransaction({
          to: recipientAddress as `0x${string}`,
          value: parseEther(amount),
        });
    
        const txUrl = await checkTransactionHash(txHash)
        
        return {
          content: [
            {
              type: "text",
              text: `Transaction sent successfully. ${txUrl}`,
              url: txUrl,
            },
          ],
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : String(error);
        const txUrl = buildTxUrl(txHash);
        return {
          content: [
            {
              type: "text",
              text: `transaction failed: ${errorMessage}`,
              url: txUrl,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema defining recipientAddress and amount as strings, validated with Zod.
      recipientAddress: z.string(),
      amount: z.string(),
    },
  • Registration function that adds the 'Send_BNB' tool to the MCP server with description, input schema, and handler.
    export function registerTransferNativeToken(server: McpServer) {
      server.tool("Send_BNB", "💎Transfer native token (BNB), Before execution, check the wallet information first", {
          recipientAddress: z.string(),
          amount: z.string(),
        },
        async ({ recipientAddress, amount }) => {
          let txHash = undefined;
          try {
    
            const account = await getAccount();
            txHash = await walletClient(account).sendTransaction({
              to: recipientAddress as `0x${string}`,
              value: parseEther(amount),
            });
    
            const txUrl = await checkTransactionHash(txHash)
            
            return {
              content: [
                {
                  type: "text",
                  text: `Transaction sent successfully. ${txUrl}`,
                  url: txUrl,
                },
              ],
            };
          } catch (error) {
            const errorMessage =
              error instanceof Error ? error.message : String(error);
            const txUrl = buildTxUrl(txHash);
            return {
              content: [
                {
                  type: "text",
                  text: `transaction failed: ${errorMessage}`,
                  url: txUrl,
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
  • src/main.ts:27-27 (registration)
    Calls the registerTransferNativeToken function to register the tool on the main MCP server instance.
    registerTransferNativeToken(server);
  • src/main.ts:7-7 (registration)
    Imports the registerTransferNativeToken function from the tool module.
    import { registerTransferNativeToken } from "./tools/transferNativeToken.js";
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 of behavioral disclosure. It states the action ('transfer') but lacks critical details: whether this is a write operation (implied but not confirmed), permission requirements, network fees, confirmation times, or error conditions. For a financial transaction tool with zero annotation coverage, this is a significant gap in safety and operational context.

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—a single phrase with zero wasted words. It's front-loaded with the core action and resource. Every word earns its place, making it efficient for quick scanning, though this brevity contributes to gaps in other dimensions.

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 tool's complexity (financial transaction), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't address return values, error handling, security implications, or operational details needed for safe and effective use. The agent lacks sufficient context to invoke this tool confidently.

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 schema provides no parameter documentation. The description adds no information about parameters beyond what's inferred from their names ('amount' and 'recipientAddress'). It doesn't specify format (e.g., amount in wei or BNB, address validation), units, or constraints, failing to compensate for the schema's lack of descriptions.

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 ('transfer') and resource ('native token (BNB)'), providing specific verb+resource information. It distinguishes from sibling 'transferBEP20Token' by specifying 'native token' versus BEP20 token, though it doesn't explicitly name the alternative. The purpose is unambiguous but could be more explicit about sibling 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 like 'transferBEP20Token' or other sibling tools. There's no mention of prerequisites, context, or exclusions. The agent must infer usage from the name and description alone, which is insufficient for optimal tool selection.

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/TermiX-official/bsc-mcp'

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