Skip to main content
Glama
ocean1

Claude Consciousness Bridge

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

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