Skip to main content
Glama

list_memory_bank_files

Retrieve a list of files stored in the memory bank on the MCP server with SSH support for centralized knowledge management.

Instructions

List Memory Bank files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The handler function that executes the list_memory_bank_files tool by listing files in the Memory Bank using memoryBankManager.listFiles() and returning the formatted list.
    export async function handleListMemoryBankFiles(
      memoryBankManager: MemoryBankManager
    ) {
      try {
        const files = await memoryBankManager.listFiles();
    
        return {
          content: [
            {
              type: 'text',
              text: `Files in Memory Bank:\n${files.join('\n')}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error listing Memory Bank files: ${error}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The schema definition for the list_memory_bank_files tool, including name, description, and inputSchema with a dummy required parameter.
    {
      name: 'list_memory_bank_files',
      description: 'List Memory Bank files',
      inputSchema: {
        type: 'object',
        properties: {
          random_string: {
            type: 'string',
            description: 'Dummy parameter for no-parameter tools',
          },
        },
        required: ['random_string'],
      },
  • The switch case in the CallToolRequestHandler that dispatches to the handleListMemoryBankFiles function after checking if Memory Bank exists.
    case 'list_memory_bank_files': {
      if (!memoryBankManager.getMemoryBankDir()) {
        return {
          content: [
            {
              type: 'text',
              text: 'Memory Bank not found. Use initialize_memory_bank to create one.',
            },
          ],
          isError: true,
        };
      }
      return handleListMemoryBankFiles(memoryBankManager);
  • Registers the tool schemas, including list_memory_bank_files from coreTools, for the ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        ...coreTools,
        ...progressTools,
        ...contextTools,
        ...decisionTools,
        ...modeTools,
      ],
    }));

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