Skip to main content
Glama

addressbook_manage

Manage Hedera account address books for multi-account workflows. Add, import, list, update, or remove accounts to organize and reference them efficiently.

Instructions

Manage Hedera account address book for multi-account workflows.

OPERATIONS:

  • add: Add account to address book (reference only, no private key)

  • import: Import account WITH private key for transaction signing

  • list: Show all saved accounts with aliases and metadata

  • update: Update account nickname

  • remove: Remove account from address book

USE THIS FOR: Managing multiple accounts, organizing workflows, quick account reference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYesAddress book operation
accountIdNoHedera account ID (for add/import)
aliasNoUnique alias for quick reference
nicknameNoHuman-readable name
privateKeyNoPrivate key in DER format (for import only)

Implementation Reference

  • Main handler function for the 'addressbook_manage' tool. Dispatches to specific accountTools based on the 'operation' parameter (add, list, remove, update, import).
    export async function addressBookManage(args: {
      operation: 'add' | 'list' | 'remove' | 'update' | 'import';
      // Common
      alias?: string;
      nickname?: string;
      // Add/Import specific
      accountId?: string;
      privateKey?: string;
    }): Promise<ToolResult> {
      try {
        logger.info('Address book operation', { operation: args.operation });
    
        switch (args.operation) {
          case 'add':
            return await accountTools.addToAddressBook({
              accountId: args.accountId!,
              alias: args.alias!,
              nickname: args.nickname,
            });
    
          case 'list':
            return await accountTools.listAddressBook();
    
          case 'remove':
            return await accountTools.removeFromAddressBook({
              alias: args.alias!,
            });
    
          case 'update':
            return await accountTools.updateAddressBook({
              alias: args.alias!,
              nickname: args.nickname!,
            });
    
          case 'import':
            return await accountTools.importAccount({
              accountId: args.accountId!,
              privateKey: args.privateKey!,
              alias: args.alias!,
              nickname: args.nickname,
            });
    
          default:
            return {
              success: false,
              error: `Unknown address book operation: ${args.operation}`,
            };
        }
      } catch (error) {
        logger.error('Address book operation failed', { operation: args.operation, error });
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • Tool schema definition for 'addressbook_manage' including name, description, and inputSchema with operation enum and parameters.
      {
        name: 'addressbook_manage',
        description: `Manage Hedera account address book for multi-account workflows.
    
    OPERATIONS:
    - add: Add account to address book (reference only, no private key)
    - import: Import account WITH private key for transaction signing
    - list: Show all saved accounts with aliases and metadata
    - update: Update account nickname
    - remove: Remove account from address book
    
    USE THIS FOR: Managing multiple accounts, organizing workflows, quick account reference.`,
        inputSchema: {
          type: 'object' as const,
          properties: {
            operation: {
              type: 'string',
              enum: ['add', 'import', 'list', 'remove', 'update'],
              description: 'Address book operation',
            },
            accountId: {
              type: 'string',
              description: 'Hedera account ID (for add/import)',
            },
            alias: {
              type: 'string',
              description: 'Unique alias for quick reference',
            },
            nickname: {
              type: 'string',
              description: 'Human-readable name',
            },
            privateKey: {
              type: 'string',
              description: 'Private key in DER format (for import only)',
            },
          },
          required: ['operation'],
        },
      },
  • src/index.ts:591-592 (registration)
    Registration and dispatch of 'addressbook_manage' tool call in the main MCP server request handler switch statement.
    case 'addressbook_manage':
      result = await addressBookManage(args as any);
  • Helper function 'addToAddressBook' called by addressbook_manage for 'add' operation. Adds account reference to address book service.
    export async function addToAddressBook(args: {
      accountId: string;
      alias: string;
      nickname?: string;
    }): Promise<ToolResult> {
      try {
        logger.info('Adding to address book', { accountId: args.accountId, alias: args.alias });
    
        if (addressBook.count() === 0) {
          await addressBook.initialize();
        }
    
        // Verify the account exists
        const accountInfo = await hederaClient.getAccountInfo(args.accountId);
    
        await addressBook.add({
          accountId: args.accountId,
          alias: args.alias,
          nickname: args.nickname,
          publicKey: accountInfo.key,
          memo: accountInfo.memo,
        });
    
        return {
          success: true,
          data: {
            accountId: args.accountId,
            alias: args.alias,
            addedToAddressBook: true,
          },
        };
      } catch (error) {
        logger.error('Failed to add to address book', { error });
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • Helper function 'listAddressBook' called by addressbook_manage for 'list' operation. Lists all address book entries without exposing private keys.
    export async function listAddressBook(): Promise<ToolResult> {
      try {
        if (addressBook.count() === 0) {
          await addressBook.initialize();
        }
    
        const entries = addressBook.list();
    
        // Remove private keys from the response
        const safeEntries = entries.map((entry) => ({
          accountId: entry.accountId,
          alias: entry.alias,
          nickname: entry.nickname,
          publicKey: entry.publicKey,
          memo: entry.memo,
          createdAt: entry.createdAt,
          updatedAt: entry.updatedAt,
          hasPrivateKey: !!entry.privateKey,
        }));
    
        return {
          success: true,
          data: {
            count: entries.length,
            accounts: safeEntries,
          },
        };
      } catch (error) {
        logger.error('Failed to list address book', { error });
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
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 does well by explaining key behavioral traits: distinguishing between 'add' (reference only, no private key) and 'import' (with private key for transaction signing), and specifying that operations work on saved accounts with aliases. However, it doesn't mention potential side effects like data persistence, error conditions, or security implications of handling private keys.

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 (OPERATIONS, USE THIS FOR) and uses bullet points for operations. Every sentence earns its place: the opening establishes purpose, operations are clearly listed with brief explanations, and the usage guideline is front-loaded. No wasted words or redundancy.

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?

Given no annotations and no output schema, the description does a good job covering the tool's functionality. It explains all operations, their purposes, and usage context. However, it doesn't describe what the tool returns (e.g., success confirmation, list output format, error messages), which would be helpful since there's no output schema. For a multi-operation tool with behavioral nuances, this is a minor gap.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds significant value by explaining the semantic differences between operations: 'add' vs 'import' clarifies when privateKey is needed, and 'update' specifies it's for nicknames. It also clarifies that alias is for 'quick reference' and operations apply to 'saved accounts.' This provides context beyond the schema's technical descriptions.

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 tool's purpose: managing Hedera account address books for multi-account workflows. It specifies the exact operations (add, import, list, update, remove) and distinguishes this from sibling tools like account_create, account_info, or transfer_hbar by focusing on address book management rather than account creation, information retrieval, or transactions.

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

Usage Guidelines5/5

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

The description explicitly states 'USE THIS FOR: Managing multiple accounts, organizing workflows, quick account reference.' This provides clear guidance on when to use this tool versus alternatives. It differentiates from account management tools by focusing on address book organization rather than direct account operations.

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