Skip to main content
Glama

transfer_hbar

Execute HBAR transfers between Hedera accounts to fund wallets, make payments, or move cryptocurrency using the HashPilot MCP server.

Instructions

Transfer HBAR between Hedera accounts.

EXECUTES: CryptoTransfer transaction from source to destination REQUIRES: Operator account must be source OR have signing authority COSTS: Standard network transaction fee

USE FOR: Funding accounts, payments, moving HBAR between wallets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesSource account ID
toYesDestination account ID
amountYesHBAR amount to transfer

Implementation Reference

  • Primary MCP tool handler for 'transfer_hbar'. Executes the transfer by delegating to hederaCLI 'transfer hbar' command and handles errors.
    export async function transferHbar(args: {
      from: string;
      to: string;
      amount: number;
    }): Promise<ToolResult> {
      try {
        logger.info('Transferring HBAR', { from: args.from, to: args.to, amount: args.amount });
    
        const result = await hederaCLI.executeCommand({
          command: 'transfer hbar',
          args: {
            from: args.from,
            to: args.to,
            amount: args.amount,
          },
        });
    
        return result;
      } catch (error) {
        logger.error('Failed to transfer HBAR', { error });
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
  • Input schema and description for the 'transfer_hbar' tool in the MCP server's optimizedToolDefinitions array.
      {
        name: 'transfer_hbar',
        description: `Transfer HBAR between Hedera accounts.
    
    EXECUTES: CryptoTransfer transaction from source to destination
    REQUIRES: Operator account must be source OR have signing authority
    COSTS: Standard network transaction fee
    
    USE FOR: Funding accounts, payments, moving HBAR between wallets.`,
        inputSchema: {
          type: 'object' as const,
          properties: {
            from: { type: 'string', description: 'Source account ID' },
            to: { type: 'string', description: 'Destination account ID' },
            amount: { type: 'number', description: 'HBAR amount to transfer' },
          },
          required: ['from', 'to', 'amount'],
        },
      },
  • src/index.ts:575-577 (registration)
    Registration and dispatch logic in the MCP CallToolRequestSchema handler switch statement.
    case 'transfer_hbar':
      result = await transferHbar(args as { from: string; to: string; amount: number });
      break;
  • Low-level Hedera SDK helper function for HBAR transfers using TransferTransaction, used by hederaCLI.
    async transferHbar(
      fromAccountId: string,
      toAccountId: string,
      amount: number
    ): Promise<{ transactionId: string; status: string }> {
      try {
        const client = this.getClient();
    
        const transaction = await new TransferTransaction()
          .addHbarTransfer(fromAccountId, new Hbar(-amount))
          .addHbarTransfer(toAccountId, new Hbar(amount))
          .execute(client);
    
        const receipt = await transaction.getReceipt(client);
    
        return {
          transactionId: transaction.transactionId.toString(),
          status: receipt.status.toString(),
        };
      } catch (error) {
        logger.error('Failed to transfer HBAR', { fromAccountId, toAccountId, amount, error });
        throw error;
      }
    }
  • Additional schema definition in accountTools export (potentially used or reference).
    name: 'transfer_hbar',
    description:
      'Transfer HBAR from one Hedera account to another. The transaction will be signed by the operator account.',
    inputSchema: {
      type: 'object' as const,
      properties: {
        from: {
          type: 'string',
          description: 'Source account ID (format: 0.0.xxxxx)',
          pattern: '^0\\.0\\.\\d+$',
        },
        to: {
          type: 'string',
          description: 'Destination account ID (format: 0.0.xxxxx)',
          pattern: '^0\\.0\\.\\d+$',
        },
        amount: {
          type: 'number',
          description: 'Amount of HBAR to transfer',
          minimum: 0,
        },
      },
      required: ['from', 'to', 'amount'],
    },
Behavior4/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 effectively explains execution details (CryptoTransfer transaction), prerequisites (operator account requirements), and costs (standard network transaction fee), covering key behavioral aspects beyond basic functionality.

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 well-structured with clear sections (purpose, execution, requirements, costs, usage) and uses bullet-like formatting. Every sentence adds value with no redundancy, making it efficiently front-loaded and easy to parse.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by covering purpose, execution, requirements, costs, and usage scenarios. It could improve by mentioning error cases or response format, but it's largely complete given the context.

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?

Schema description coverage is 100%, so the schema already documents all three parameters (from, to, amount). The description doesn't add any parameter-specific information beyond what's in the schema, such as format examples or constraints, meeting the baseline for high schema coverage.

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 specific action ('Transfer HBAR') and resource ('between Hedera accounts'), distinguishing it from sibling tools like account_balance or token_manage. It explicitly mentions executing a CryptoTransfer transaction, which provides precise operational context.

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

Usage Guidelines4/5

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

The description includes a 'USE FOR' section listing specific scenarios (funding accounts, payments, moving HBAR between wallets), which gives clear context for when to use this tool. However, it doesn't explicitly state when NOT to use it or name alternatives among siblings.

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/justmert/hashpilot'

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