check_memory_bank_status
Verify if the memory-bank directory exists and retrieve a list of .md files to maintain persistent project context in AI assistants.
Instructions
Checks if the memory-bank directory exists and lists the .md files within it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:153-163 (handler)The handler function that checks the memory-bank directory existence and lists .md files within it, returning JSON status.async checkMemoryBankStatus(): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> { try { await fs.access(MEMORY_BANK_PATH); const files = await fs.readdir(MEMORY_BANK_PATH); const mdFiles = files.filter(f => f.endsWith('.md')); return { content: [{ type: "text", text: JSON.stringify({ exists: true, files: mdFiles }, null, 2) }] }; } catch (error) { // If access fails, directory likely doesn't exist return { content: [{ type: "text", text: JSON.stringify({ exists: false, files: [] }, null, 2) }] }; } }
- src/index.ts:268-269 (registration)Switch case in CallToolRequestHandler that registers and dispatches the tool call to the handler.case "check_memory_bank_status": return memoryBankServer.checkMemoryBankStatus();
- src/index.ts:63-68 (schema)Tool definition including name, description, and input schema (empty object since no input params required).const CHECK_MEMORY_BANK_STATUS_TOOL: Tool = { name: "check_memory_bank_status", description: "Checks if the memory-bank directory exists and lists the .md files within it.", inputSchema: { type: "object", properties: {} } // No input needed // Output: { exists: boolean, files: string[] } (handled in implementation) };
- src/index.ts:110-115 (registration)Array of all tools including CHECK_MEMORY_BANK_STATUS_TOOL, used for listing tools.const ALL_TOOLS = [ INITIALIZE_MEMORY_BANK_TOOL, CHECK_MEMORY_BANK_STATUS_TOOL, READ_MEMORY_BANK_FILE_TOOL, APPEND_MEMORY_BANK_ENTRY_TOOL ];