Skip to main content
Glama
IncomeStreamSurfer

Roo Code Memory Bank MCP Server

read_memory_bank_file

Extracts and retrieves the complete content of a specified memory bank file to maintain persistent project context for AI assistants, ensuring information continuity across sessions.

Instructions

Reads the full content of a specified memory bank file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_nameYesThe name of the memory bank file (e.g., 'productContext.md')

Implementation Reference

  • The handler function in RooMemoryBankServer class that reads the content of the specified memory bank file and returns it as JSON.
    async readMemoryBankFile(input: any): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> {
      const fileName = input?.file_name;
      if (!fileName || typeof fileName !== 'string') {
        return { content: [{ type: "text", text: JSON.stringify({ status: "error", message: "Missing or invalid 'file_name' parameter." }, null, 2) }], isError: true };
      }
      const filePath = path.join(MEMORY_BANK_PATH, fileName);
      try {
        const fileContent = await fs.readFile(filePath, 'utf-8');
        return { content: [{ type: "text", text: JSON.stringify({ content: fileContent }, null, 2) }] };
      } catch (error: any) {
        console.error(chalk.red(`Error reading file ${fileName}:`), error);
        return { content: [{ type: "text", text: JSON.stringify({ status: "error", message: `Failed to read file ${fileName}: ${error.message}` }, null, 2) }], isError: true };
      }
    }
  • Tool schema definition including name, description, and input schema with required 'file_name' parameter.
    const READ_MEMORY_BANK_FILE_TOOL: Tool = {
      name: "read_memory_bank_file",
      description: "Reads the full content of a specified memory bank file.",
      inputSchema: {
        type: "object",
        properties: {
          file_name: {
            type: "string",
            description: "The name of the memory bank file (e.g., 'productContext.md')"
          }
        },
        required: ["file_name"]
      }
      // Output: { content: string } (handled in implementation)
    };
  • src/index.ts:110-115 (registration)
    Registers the tool by including it in the ALL_TOOLS array, used for listing available tools via ListToolsRequestHandler.
    const ALL_TOOLS = [
      INITIALIZE_MEMORY_BANK_TOOL,
      CHECK_MEMORY_BANK_STATUS_TOOL,
      READ_MEMORY_BANK_FILE_TOOL,
      APPEND_MEMORY_BANK_ENTRY_TOOL
    ];
  • src/index.ts:270-271 (registration)
    Registers the tool call handler by dispatching to the readMemoryBankFile method in the CallToolRequestSchema switch statement.
    case "read_memory_bank_file":
      return memoryBankServer.readMemoryBankFile(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Reads') but lacks details on permissions, error handling (e.g., what happens if the file doesn't exist), or output format (e.g., plain text, structured data). This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like error cases or output format, which are crucial for a read operation. The high schema coverage helps with parameters, but overall context is insufficient for reliable tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'file_name' well-documented in the schema itself. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Reads') and resource ('full content of a specified memory bank file'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'check_memory_bank_status' or 'append_memory_bank_entry', which might involve reading or checking content in different ways.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this should be used for retrieving entire files versus checking status or appending entries, leaving the agent to infer usage from tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/IncomeStreamSurfer/roo-code-memory-bank-mcp-server'

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