generate_memory_bank_template
Create structured templates for Memory Bank files to organize project documentation and preserve context in AI assistant environments.
Instructions
Generate a template for a specific Memory Bank file.
Args:
file_name: The name of the file to generate a template for (e.g., "projectbrief.md")
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_name | Yes |
Implementation Reference
- src/mcp_memory_bank/main.py:42-53 (handler)The handler function decorated with @mcp.tool(), implementing the core logic to generate a Memory Bank template based on the provided file_name by returning from the TEMPLATES dict or an error message.@mcp.tool() async def generate_memory_bank_template(file_name: str) -> str: """Generate a template for a specific Memory Bank file. Args: file_name: The name of the file to generate a template for (e.g., "projectbrief.md") """ if file_name in TEMPLATES: return TEMPLATES[file_name] else: available_templates = ", ".join(TEMPLATES.keys()) return f"Template for {file_name} not found. Available templates: {available_templates}"
- src/mcp_memory_bank/main.py:18-26 (helper)Dictionary mapping file names to template strings, imported from various template modules, used by the generate_memory_bank_template handler.TEMPLATES = { "memory_bank_instructions.md": MEMORY_BANK_INSTRUCTIONS_TEMPLATE, "projectbrief.md": PROJECTBRIEF_TEMPLATE, "productContext.md": PRODUCT_CONTEXT_TEMPLATE, "activeContext.md": ACTIVE_CONTEXT_TEMPLATE, "systemPatterns.md": SYSTEM_PATTERNS_TEMPLATE, "techContext.md": TECH_CONTEXT_TEMPLATE, "progress.md": PROGRESS_TEMPLATE }
- src/mcp_memory_bank/main.py:42-42 (registration)The @mcp.tool() decorator registers the generate_memory_bank_template function as an MCP tool.@mcp.tool()