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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "getProtocolTemplate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | No | Template version to retrieve | v2 |
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'), }); - src/consciousness-protocol-tools.ts:1577-1589 (registration)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', }, }, }, }, - src/consciousness-rag-server-clean.ts:83-84 (registration)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), }, ], }; }