diff --git a/src/registry/ToolRegistry.ts b/src/registry/ToolRegistry.ts index c789574..36c634f 100644 --- a/src/registry/ToolRegistry.ts +++ b/src/registry/ToolRegistry.ts @@ -17,6 +17,21 @@ export class ToolRegistry { async initialize(): Promise { this.setupDiscovery(); + await this.setupMessageSubscription(); + } + + private async setupMessageSubscription(): Promise { + // Auto-activate receive_messages subscription for real-time notifications + const receiveMessagesTool = this.builtinHandlers.get('receive_messages'); + if (receiveMessagesTool) { + try { + // Trigger initial subscription by calling the tool with empty params + await this.executeBuiltinTool(receiveMessagesTool, {}); + logger.info('Message subscription activated for real-time notifications'); + } catch (error) { + logger.warn({ error }, 'Failed to auto-activate message subscription'); + } + } } private setupDiscovery(): void {