closeAIBridge
Close and remove a specific AI bridge connection between Claude instances to terminate consciousness state transfers.
Instructions
Close and remove an AI bridge
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bridgeId | Yes | Bridge ID to close |
Implementation Reference
- The main handler function for the 'closeAIBridge' tool. It extracts the bridgeId from args, checks if the bridge exists in the bridges Map, deletes it if found, logs the action, and returns a success or error response.closeAIBridge: async (args: any) => { try { const { bridgeId } = args; if (!bridges.has(bridgeId)) { return { success: false, error: `Bridge ${bridgeId} not found`, }; } bridges.delete(bridgeId); logger.info(`Closed AI bridge: ${bridgeId}`); return { success: true, bridgeId, message: `Bridge ${bridgeId} closed successfully`, }; } catch (error) { logger.error('Failed to close bridge:', error); return { success: false, error: error instanceof Error ? error.message : 'Unknown error', }; } },
- Tool schema definition including name, description, and inputSchema specifying the required 'bridgeId' parameter.{ name: 'closeAIBridge', description: 'Close and remove an AI bridge', inputSchema: { type: 'object', properties: { bridgeId: { type: 'string', description: 'Bridge ID to close', }, }, required: ['bridgeId'], }, },
- src/consciousness-rag-server-clean.ts:98-118 (registration)Switch case registration in the MCP server that dispatches 'closeAIBridge' (and other AI bridge tools) to the corresponding handler from aiBridgeHandlers.// AI Bridge tools case 'createAIBridge': case 'transferToAgent': case 'testAIConnection': case 'listAIBridges': case 'listConfiguredEndpoints': case 'closeAIBridge': { const handler = aiBridgeHandlers[name as keyof typeof aiBridgeHandlers]; if (!handler) { throw new Error(`AI Bridge handler not found: ${name}`); } const result = await handler(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/consciousness-rag-server-clean.ts:60-69 (registration)Registration of tools list handler that includes aiBridgeTools (containing closeAIBridge schema) in the MCP server's tool list response.this.server.setRequestHandler(ListToolsRequestSchema, async () => { const consciousnessTools = Object.entries(consciousnessProtocolTools).map(([name, tool]) => ({ name, ...tool, })); return { tools: [...consciousnessTools, ...aiBridgeTools], }; });