Skip to main content
Glama

read_memory_bank_file

Retrieve and access specific files stored in the memory bank via SSH with the MCP server. Input the filename to read its contents efficiently from the central knowledge base.

Instructions

Read a file from the Memory Bank

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesName of the file to read

Implementation Reference

  • The main handler function for the 'read_memory_bank_file' tool. It reads the specified file from the Memory Bank using memoryBankManager.readFile() and returns its content as text, or an error message if reading fails.
    export async function handleReadMemoryBankFile( memoryBankManager: MemoryBankManager, filename: string ) { try { const content = await memoryBankManager.readFile(filename); return { content: [ { type: 'text', text: content, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error reading file ${filename}: ${error}`, }, ], isError: true, }; } }
  • The input schema definition for the 'read_memory_bank_file' tool, specifying that it requires a 'filename' string parameter.
    { name: 'read_memory_bank_file', description: 'Read a file from the Memory Bank', inputSchema: { type: 'object', properties: { filename: { type: 'string', description: 'Name of the file to read', }, }, required: ['filename'], }, },
  • The switch case in the tool call handler that validates input, checks for Memory Bank directory, and dispatches to the handleReadMemoryBankFile function.
    case 'read_memory_bank_file': { if (!memoryBankManager.getMemoryBankDir()) { return { content: [ { type: 'text', text: 'Memory Bank not found. Use initialize_memory_bank to create one.', }, ], isError: true, }; } const { filename } = request.params.arguments as { filename: string }; if (!filename) { throw new McpError(ErrorCode.InvalidParams, 'Filename not specified'); } return handleReadMemoryBankFile(memoryBankManager, filename); }

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/aakarsh-sasi/memory-bank-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server