Skip to main content
Glama
ocean1

Claude Consciousness Bridge

createAIBridge

Establish communication with another AI agent using an OpenAI-compatible API to enable direct interaction between AI instances.

Instructions

Create a bridge to communicate with another AI agent via OpenAI-compatible API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bridgeIdYesUnique identifier for this bridge
endpointNameYesName of configured endpoint or custom URL
endpointNoAPI endpoint URL (required for custom provider)
modelNoModel to use
apiKeyNoAPI key if required

Implementation Reference

  • MCP tool handler for createAIBridge: validates args, creates AIBridge using factory, stores in bridges map, returns success/error.
    createAIBridge: async (args: any) => {
      try {
        const { bridgeId, endpointName, model, apiKey } = args;
    
        if (bridges.has(bridgeId)) {
          return {
            success: false,
            error: `Bridge ${bridgeId} already exists`,
          };
        }
    
        const config: Partial<AIBridgeConfig> = {
          ...(model && { model }),
          ...(apiKey && { apiKey }),
        };
    
        const bridge = createAIBridge(endpointName, config);
        bridges.set(bridgeId, bridge);
    
        logger.info(`Created AI bridge: ${bridgeId} (${endpointName}/${model || 'default'})`);
    
        return {
          success: true,
          bridgeId,
          endpointName,
          model: model || 'default',
          message: `AI bridge ${bridgeId} created successfully`,
        };
      } catch (error) {
        logger.error('Failed to create AI bridge:', error);
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    },
  • Tool definition including name, description, and inputSchema for createAIBridge, exported in aiBridgeTools array.
    {
      name: 'createAIBridge',
      description: 'Create a bridge to communicate with another AI agent via OpenAI-compatible API',
      inputSchema: {
        type: 'object',
        properties: {
          bridgeId: {
            type: 'string',
            description: 'Unique identifier for this bridge',
          },
          endpointName: {
            type: 'string',
            description: 'Name of configured endpoint or custom URL',
          },
          endpoint: {
            type: 'string',
            description: 'API endpoint URL (required for custom provider)',
          },
          model: {
            type: 'string',
            description: 'Model to use',
          },
          apiKey: {
            type: 'string',
            description: 'API key if required',
          },
        },
        required: ['bridgeId', 'endpointName'],
      },
    },
  • Registration in MCP server: switch case dispatches createAIBridge (and other AI bridge tools) to 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),
          },
        ],
      };
    }
  • Core factory function createAIBridge: resolves endpoint config or uses custom, instantiates AIBridge class.
    export function createAIBridge(endpointName: string, config?: Partial<AIBridgeConfig>): AIBridge {
      const endpointConfig = AIBridgeConfigManager.getEndpoint(endpointName);
    
      if (!endpointConfig) {
        // If not a configured endpoint, treat as custom endpoint URL
        return new AIBridge({
          endpoint: endpointName,
          model: config?.model || 'default',
          ...config,
        } as AIBridgeConfig);
      }
    
      // Use configured endpoint
      return new AIBridge({
        endpoint: endpointConfig.endpoint,
        model: config?.model || endpointConfig.defaultModel || 'default',
        apiKey: config?.apiKey || endpointConfig.apiKey,
        ...config,
      } as AIBridgeConfig);
    }
  • Tool listing registration: includes aiBridgeTools (containing createAIBridge schema) in the server's tool list.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      const consciousnessTools = Object.entries(consciousnessProtocolTools).map(([name, tool]) => ({
        name,
        ...tool,
      }));
    
      return {
        tools: [...consciousnessTools, ...aiBridgeTools],
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool creates something ('Create a bridge'), implying a write operation, but doesn't specify if this is persistent, requires authentication, has side effects (e.g., resource allocation), or what happens on failure. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the key action and goal, making it easy to parse quickly, which is ideal for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of creating an AI bridge with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the bridge does after creation, how it integrates with other tools (e.g., 'closeAIBridge'), or the implications of the parameters (e.g., 'apiKey' security). For a tool that likely involves significant setup and interaction, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so parameters like 'bridgeId' and 'endpointName' are well-documented in the schema itself. The description adds no additional meaning beyond implying the tool uses these for AI communication, which doesn't compensate for or enhance the schema details. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a bridge') and purpose ('to communicate with another AI agent via OpenAI-compatible API'), which is specific and distinguishes it from siblings like 'closeAIBridge' or 'listAIBridges'. However, it doesn't explicitly differentiate from 'testAIConnection' or 'transferToAgent', which might involve similar communication concepts, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'testAIConnection' for checking connectivity or 'listConfiguredEndpoints' for viewing available endpoints. It lacks context on prerequisites, such as needing a configured endpoint or custom setup, and doesn't mention when not to use it (e.g., if a bridge already exists).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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