Skip to main content
Glama

Claude Consciousness Bridge

closeAIBridge

Terminate and remove an active AI bridge to stop consciousness transfer between two Claude instances using the specified bridge ID. Ensures controlled session management.

Instructions

Close and remove an AI bridge

Input Schema

NameRequiredDescriptionDefault
bridgeIdYesBridge ID to close

Input Schema (JSON Schema)

{ "properties": { "bridgeId": { "description": "Bridge ID to close", "type": "string" } }, "required": [ "bridgeId" ], "type": "object" }

Implementation Reference

  • The async handler function that closes an AI bridge by deleting it from the shared bridges Map and logging the action.
    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 in aiBridgeTools array, specifying name, description, and input schema requiring bridgeId.
    { name: 'closeAIBridge', description: 'Close and remove an AI bridge', inputSchema: { type: 'object', properties: { bridgeId: { type: 'string', description: 'Bridge ID to close', }, }, required: ['bridgeId'], }, },
  • Dispatch handler in MCP server switch statement that calls the closeAIBridge handler from aiBridgeHandlers.
    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), }, ], }; }
  • MCP ListToolsRequestHandler that includes aiBridgeTools (containing closeAIBridge schema) in the tools list.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { const consciousnessTools = Object.entries(consciousnessProtocolTools).map(([name, tool]) => ({ name, ...tool, })); return { tools: [...consciousnessTools, ...aiBridgeTools], }; });

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/ocean1/mcp_consciousness_bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server