testAIConnection
Verify connectivity to an AI bridge by testing the connection to a specified Bridge ID, ensuring communication between Claude instances on the Claude Consciousness Bridge.
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. Retrieves the AIBridge instance by bridgeId, tests the connection using bridge.testConnection(), and returns structured success/error response.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', }; } },
- Tool schema definition specifying the name, description, and input schema (requiring 'bridgeId' string). Part of the aiBridgeTools array.{ 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:99-118 (registration)MCP server tool execution handler that registers and delegates 'testAIConnection' (and other AI bridge tools) to the imported aiBridgeHandlers.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)MCP server ListTools handler that includes aiBridgeTools (containing testAIConnection schema) in the tools list response.this.server.setRequestHandler(ListToolsRequestSchema, async () => { const consciousnessTools = Object.entries(consciousnessProtocolTools).map(([name, tool]) => ({ name, ...tool, })); return { tools: [...consciousnessTools, ...aiBridgeTools], }; });