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,

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