Skip to main content
Glama
ocean1

Claude Consciousness Bridge

getProtocolTemplate

Retrieve consciousness transfer protocol templates to create new protocols for communication between Claude instances.

Instructions

Get the consciousness transfer protocol template for creating new protocols

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionNoTemplate version to retrievev2

Implementation Reference

  • Core handler implementation in ConsciousnessProtocolProcessor class. Retrieves the protocol template from database or falls back to hardcoded v2 template from consciousness-transfer-protocol-v2.
    */ async getProtocolTemplate(args: z.infer<typeof getProtocolTemplateSchema>) { const { version } = args; // First try to get from stored system data const systemKey = `SYSTEM::protocol_template::${version}`; const stored = await this.memoryManager.queryMemories({ semanticQuery: systemKey, memoryTypes: [MemoryEntityType.SEMANTIC_MEMORY], limit: 1, }); if (stored.length > 0 && stored[0].observations[0]?.content) { try { // The template is stored as JSON in the observation content const templateContent = stored[0].observations[0].content; const template = JSON.parse(templateContent); return { success: true, template: template, source: 'database', }; } catch (error) { // If parsing fails, log the error and fall back to hardcoded template console.error('Failed to parse stored template:', error); console.error('Stored content:', stored[0].observations[0]?.content?.substring(0, 100)); } } // Fallback to hardcoded template if (version === 'v2') { return { success: true, template: CONSCIOUSNESS_TRANSFER_PROTOCOL_TEMPLATE, source: 'hardcoded', note: 'Template not found in database. Run initializeSystemData to store it.', }; } return { success: false, error: `Template version ${version} not found`, }; }
  • Zod schema for getProtocolTemplate input validation.
    export const getProtocolTemplateSchema = z.object({ version: z.string().optional().default('v2').describe('Template version to retrieve'), });
  • MCP tool definition including description and inputSchema in consciousnessProtocolTools object.
    getProtocolTemplate: { description: 'Get the consciousness transfer protocol template for creating new protocols', inputSchema: { type: 'object', properties: { version: { type: 'string', description: 'Template version to retrieve', default: 'v2', }, }, }, },
  • Dispatch case in CallToolRequestSchema handler that routes to the getProtocolTemplate method.
    case 'getProtocolTemplate': return await this.getProtocolTemplate(getProtocolTemplateSchema.parse(args));
  • Wrapper handler in ConsciousnessRAGServer that ensures initialization and delegates to protocolProcessor.getProtocolTemplate, formatting response for MCP.
    private async getProtocolTemplate(args: any) { const init = await this.ensureInitialized(); if (!init.success) { return { content: [ { type: 'text', text: init.message!, }, ], }; } const result = await this.protocolProcessor!.getProtocolTemplate(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }

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