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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"random_string": "<random_string>"
},
"name": "list_memory_bank_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | Yes | Dummy parameter for no-parameter tools |
Implementation Reference
- src/server/tools/CoreTools.ts:357-382 (handler)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, }; } } - src/server/tools/CoreTools.ts:86-98 (schema)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'], }, - src/server/tools/index.ts:130-142 (registration)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); - src/server/tools/index.ts:30-38 (registration)Registers the tool schemas, including list_memory_bank_files from coreTools, for the ListToolsRequest.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ ...coreTools, ...progressTools, ...contextTools, ...decisionTools, ...modeTools, ], }));