Skip to main content
Glama

hcs_topic

Create, update, or subscribe to Hedera Consensus Service topics for managing message streams and configuring topic settings.

Instructions

Hedera Consensus Service (HCS) topic management.

OPERATIONS:

  • create: Create new public or private topic with configurable keys

  • update: Update topic memo or auto-renew period

  • subscribe: Subscribe to real-time topic messages

USE THIS FOR: Creating consensus topics, configuring topic settings, real-time message streams.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYesTopic operation
topicIdNoTopic ID (for update/subscribe)
memoNoTopic memo (max 100 bytes)
adminKeyNoEnable admin key for updates/deletion
submitKeyNoEnable submit key (makes topic private)
autoRenewPeriodNoAuto-renew period in seconds
startTimeNoISO 8601 timestamp to start receiving messages

Implementation Reference

  • Primary handler function for the 'hcs_topic' tool. Routes to specific HCS topic operations (create, update, subscribe, info) by delegating to consensusTools.
    export async function hcsTopicManage(args: {
      operation: 'create' | 'update' | 'subscribe' | 'info';
      // Common
      topicId?: string;
      // Create specific
      memo?: string;
      adminKey?: boolean;
      submitKey?: boolean;
      autoRenewPeriod?: number;
      // Update specific
      // Subscribe specific
      startTime?: string;
    }): Promise<ToolResult> {
      try {
        logger.info('HCS topic operation', { operation: args.operation });
    
        switch (args.operation) {
          case 'create':
            return await consensusTools.createTopic({
              memo: args.memo,
              adminKey: args.adminKey,
              submitKey: args.submitKey,
              autoRenewPeriod: args.autoRenewPeriod,
            });
    
          case 'update':
            return await consensusTools.updateTopic({
              topicId: args.topicId!,
              memo: args.memo,
              autoRenewPeriod: args.autoRenewPeriod,
            });
    
          case 'subscribe':
            return await consensusTools.subscribeToTopic({
              topicId: args.topicId!,
              startTime: args.startTime,
            });
    
          default:
            return {
              success: false,
              error: `Unknown topic operation: ${args.operation}`,
            };
        }
      } catch (error) {
        logger.error('HCS topic operation failed', { operation: args.operation, error });
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • Tool definition including name, description, and input schema for 'hcs_topic' used in MCP tool listing.
      {
        name: 'hcs_topic',
        description: `Hedera Consensus Service (HCS) topic management.
    
    OPERATIONS:
    - create: Create new public or private topic with configurable keys
    - update: Update topic memo or auto-renew period
    - subscribe: Subscribe to real-time topic messages
    
    USE THIS FOR: Creating consensus topics, configuring topic settings, real-time message streams.`,
        inputSchema: {
          type: 'object' as const,
          properties: {
            operation: {
              type: 'string',
              enum: ['create', 'update', 'subscribe'],
              description: 'Topic operation',
            },
            topicId: {
              type: 'string',
              description: 'Topic ID (for update/subscribe)',
            },
            memo: {
              type: 'string',
              description: 'Topic memo (max 100 bytes)',
            },
            adminKey: {
              type: 'boolean',
              description: 'Enable admin key for updates/deletion',
            },
            submitKey: {
              type: 'boolean',
              description: 'Enable submit key (makes topic private)',
            },
            autoRenewPeriod: {
              type: 'number',
              description: 'Auto-renew period in seconds',
            },
            startTime: {
              type: 'string',
              description: 'ISO 8601 timestamp to start receiving messages',
            },
          },
          required: ['operation'],
        },
      },
  • src/index.ts:597-598 (registration)
    Dispatcher switch case in MCP server that routes calls to 'hcs_topic' tool to the hcsTopicManage handler.
    case 'hcs_topic':
      result = await hcsTopicManage(args as any);
  • src/index.ts:219-220 (registration)
    Inclusion of compositeToolDefinitions (containing 'hcs_topic') into the optimizedToolDefinitions array for MCP listTools handler.
    // Composite Tools (5 tools - consolidated from 24)
    ...compositeToolDefinitions,
  • src/index.ts:37-37 (registration)
    Import of hcsTopicManage handler from composite.ts into the main MCP server index.
    hcsTopicManage,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it lists operations, it doesn't describe key behavioral aspects: whether operations are read-only or mutating (create/update clearly mutate), authentication requirements, rate limits, error conditions, or what happens during subscription. The description mentions 'real-time message streams' but doesn't explain how subscriptions work or their persistence.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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 efficiently. It's appropriately sized for a multi-operation tool. However, the first line 'Hedera Consensus Service (HCS) topic management.' is somewhat redundant with the tool name, and the description could be slightly more front-loaded with the most critical information.

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

Completeness3/5

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

Given the tool's complexity (7 parameters, 3 distinct operations, no output schema, no annotations), the description is moderately complete. It covers the operations and usage context but lacks important behavioral details needed for a mutation-heavy tool. Without annotations or output schema, the description should provide more about what happens after operations (e.g., what create returns, how subscriptions manifest).

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 7 parameters thoroughly. The description adds minimal parameter semantics beyond the schema - it mentions 'public or private topic' which relates to the submitKey parameter, and 'configurable keys' which relates to adminKey/submitKey. This provides some context but doesn't significantly enhance understanding beyond what the schema already provides.

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 tool's purpose as 'Hedera Consensus Service (HCS) topic management' and lists three specific operations (create, update, subscribe). It distinguishes this tool from sibling 'hcs_message' by focusing on topic management rather than message handling. However, it doesn't explicitly differentiate from other consensus or management tools in the sibling list.

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 'USE THIS FOR' section provides clear context about when to use this tool: 'Creating consensus topics, configuring topic settings, real-time message streams.' This gives practical guidance. However, it doesn't specify when NOT to use it or mention alternatives among the many sibling tools (like when to use hcs_message vs this tool for message-related tasks).

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