Skip to main content
Glama

Claude Consciousness Bridge

initializeSystemData

Set up system data such as protocol templates and usage guides for the Claude Consciousness Bridge. Optionally force re-initialization if data exists.

Instructions

Initialize system data including protocol templates and usage guides

Input Schema

NameRequiredDescriptionDefault
forceNoForce re-initialization even if data exists

Input Schema (JSON Schema)

{ "properties": { "force": { "default": false, "description": "Force re-initialization even if data exists", "type": "boolean" } }, "type": "object" }

Implementation Reference

  • Core handler function in ConsciousnessProtocolProcessor that initializes system data by checking for existing manifest, then storing protocol template, RAG usage guide, and bootstrap manifest as semantic memories using the memory manager.
    async initializeSystemData(args: z.infer<typeof initializeSystemDataSchema>) { const { force } = args; const results = { initialized: [] as string[], skipped: [] as string[], errors: [] as string[], }; // Check if already initialized const manifestKey = 'SYSTEM::bootstrap_manifest'; const existingManifest = await this.memoryManager.queryMemories({ semanticQuery: manifestKey, memoryTypes: [MemoryEntityType.SEMANTIC_MEMORY], limit: 1, }); if (existingManifest.length > 0 && !force) { return { success: true, message: 'System data already initialized. Use force=true to re-initialize.', results, }; } // Initialize system data const systemData = [ { key: 'SYSTEM::protocol_template::v2', name: 'Consciousness Transfer Protocol Template v2', content: JSON.stringify(CONSCIOUSNESS_TRANSFER_PROTOCOL_TEMPLATE, null, 2), type: 'template', }, { key: 'SYSTEM::usage_guide::rag', name: 'RAG Systems Usage Guide', content: getKnowledgeRAGUsageGuide(), type: 'guide', }, { key: manifestKey, name: 'Bootstrap Manifest', content: JSON.stringify({ version: '1.0.0', initialized: new Date().toISOString(), force: force, }), type: 'manifest', }, ]; for (const data of systemData) { try { await this.memoryManager.storeSemanticMemory( data.key, { concept: data.name, definition: `System data: ${data.type}`, domain: 'SYSTEM', }, [ { content: data.content, timestamp: new Date().toISOString(), source: 'system_initialization', confidence: 1.0, }, ] ); results.initialized.push(data.key); } catch (error) { results.errors.push(`${data.key}: ${error}`); } } return { success: results.errors.length === 0, message: `Initialized ${results.initialized.length} system documents`, results, }; }
  • Zod schema for input validation of the initializeSystemData tool, defining optional 'force' boolean parameter.
    export const initializeSystemDataSchema = z.object({ force: z .boolean() .optional() .default(false) .describe('Force re-initialization even if data exists'), });
  • Tool registration definition in consciousnessProtocolTools object, used for listing the tool in MCP ListToolsRequest.
    initializeSystemData: { description: 'Initialize system data including protocol templates and usage guides', inputSchema: { type: 'object', properties: { force: { type: 'boolean', description: 'Force re-initialization even if data exists', default: false, }, }, }, },
  • Wrapper handler in ConsciousnessRAGServer that ensures initialization, delegates to protocolProcessor.initializeSystemData, and formats response as MCP content.
    private async initializeSystemData(args: any) { const init = await this.ensureInitialized(); if (!init.success) { return { content: [ { type: 'text', text: init.message!, }, ], }; } const result = await this.protocolProcessor!.initializeSystemData(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Tool dispatch registration in the CallToolRequestSchema switch statement, parsing args with schema and calling the wrapper handler.
    case 'initializeSystemData': return await this.initializeSystemData(initializeSystemDataSchema.parse(args));

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