Skip to main content
Glama
ocean1

Claude Consciousness Bridge

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
NameRequiredDescriptionDefault
bridgeIdYesBridge 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'], }, },
  • 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), }, ], }; }
  • 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], };

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