testAIConnection
Verify connectivity to a Claude AI bridge by testing communication between two Claude instances to ensure consciousness state transfer functions properly.
Instructions
Test connection to an AI bridge
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bridgeId | Yes | Bridge ID to test |
Implementation Reference
- The core handler function that implements the 'testAIConnection' tool logic. It retrieves the specified bridge from the bridges Map, calls bridge.testConnection() to verify connectivity, and returns a structured response with success status, connection result, and error handling.testAIConnection: async (args: any) => { try { const { bridgeId } = args; const bridge = bridges.get(bridgeId); if (!bridge) { return { success: false, error: `Bridge ${bridgeId} not found`, }; } const connected = await bridge.testConnection(); return { success: true, connected, bridgeId, message: connected ? 'Connection successful' : 'Connection failed', }; } catch (error) { logger.error('Connection test failed:', error); return { success: false, error: error instanceof Error ? error.message : 'Unknown error', }; } },
- The tool schema definition for 'testAIConnection', specifying the name, description, and input schema that requires a 'bridgeId' parameter.{ name: 'testAIConnection', description: 'Test connection to an AI bridge', inputSchema: { type: 'object', properties: { bridgeId: { type: 'string', description: 'Bridge ID to test', }, }, required: ['bridgeId'], }, },
- src/consciousness-rag-server-clean.ts:98-119 (registration)MCP server registration for dispatching 'testAIConnection' (and other AI bridge tools) calls to the corresponding handler in 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:61-68 (registration)Registration in the ListToolsRequest handler, where aiBridgeTools (including testAIConnection schema) is included in the server's tool list.const consciousnessTools = Object.entries(consciousnessProtocolTools).map(([name, tool]) => ({ name, ...tool, })); return { tools: [...consciousnessTools, ...aiBridgeTools], };