Skip to main content
Glama
angrysky56

Advanced Reasoning MCP Server

list_memory_libraries

Retrieve and display all available memory libraries with metadata including library names, node counts, and modification dates for organized information access.

Instructions

List all available memory libraries with metadata.

Shows all existing memory libraries with information about:

  • Library name

  • Number of memory nodes

  • Last modified date

Returns organized, searchable library information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function in CognitiveMemory class that scans the memory_data directory, reads each .json library file to count nodes, gets file stats, and returns sorted list of libraries with name, size (node count), and lastModified date.
    async listLibraries(): Promise<{ libraries: Array<{ name: string; size: number; lastModified: Date }> }> {
      try {
        const files = await fs.readdir(this.memoryDataPath);
        const libraries = [];
    
        for (const file of files) {
          if (file.endsWith('.json') && !file.endsWith('.tmp')) {
            const filePath = path.join(this.memoryDataPath, file);
            const stats = await fs.stat(filePath);
            const libraryName = file.replace('.json', '');
    
            // Get library size (node count) by reading the file
            try {
              const data = await fs.readFile(filePath, 'utf-8');
              const memoryState = JSON.parse(data);
              const nodeCount = memoryState.nodes ? memoryState.nodes.length : 0;
    
              libraries.push({
                name: libraryName,
                size: nodeCount,
                lastModified: stats.mtime
              });
            } catch (error) {
              // Skip corrupted files
              console.error(`Skipping corrupted library file: ${file}`, error);
            }
          }
        }
    
        return { libraries: libraries.sort((a, b) => b.lastModified.getTime() - a.lastModified.getTime()) };
      } catch (error) {
        console.error('Failed to list libraries:', error);
        return { libraries: [] };
      }
  • Wrapper handler in AdvancedReasoningServer that calls memory.listLibraries() and formats the MCP response with current library info and total count.
    public async listLibraries(): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> {
      try {
        const result = await this.memory.listLibraries();
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              currentLibrary: this.memory.getCurrentLibraryName(),
              libraries: result.libraries,
              totalLibraries: result.libraries.length
            }, null, 2)
          }]
        };
      } catch (error) {
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    const LIST_LIBRARIES_TOOL: Tool = {
      name: "list_memory_libraries",
      description: `List all available memory libraries with metadata.
    
    Shows all existing memory libraries with information about:
    - Library name
    - Number of memory nodes
    - Last modified date
    
    Returns organized, searchable library information.`,
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    };
  • src/index.ts:1394-1407 (registration)
    Registration of all tools including list_memory_libraries via the ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        ADVANCED_REASONING_TOOL,
        QUERY_MEMORY_TOOL,
        CREATE_LIBRARY_TOOL,
        LIST_LIBRARIES_TOOL,
        SWITCH_LIBRARY_TOOL,
        GET_LIBRARY_INFO_TOOL,
        CREATE_SYSTEM_JSON_TOOL,
        GET_SYSTEM_JSON_TOOL,
        SEARCH_SYSTEM_JSON_TOOL,
        LIST_SYSTEM_JSON_TOOL
      ],
    }));
  • src/index.ts:1424-1426 (registration)
    Tool dispatch registration in the CallToolRequestHandler switch statement.
    case "list_memory_libraries":
      return await reasoningServer.listLibraries();
Behavior3/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 describes what the tool does (lists libraries with metadata) and the return format ('organized, searchable library information'), which adds value beyond the input schema. However, it doesn't cover important behavioral aspects like whether this is a read-only operation (implied but not stated), potential rate limits, authentication needs, or pagination behavior, leaving gaps for a mutation-free tool.

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 efficiently structured: a clear purpose statement followed by bullet points for metadata details and a note on return format. Every sentence adds value without redundancy, and it's front-loaded with the core functionality. No wasted words or unnecessary elaboration, making it highly concise and well-organized.

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

Completeness4/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool does, what metadata it returns, and the nature of the output ('organized, searchable'). However, without an output schema, it could benefit from more detail on the exact return structure (e.g., JSON array format), but it adequately covers the essentials for a simple list operation.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately focuses on output semantics, detailing the metadata fields returned (library name, number of memory nodes, last modified date). This adds meaningful context beyond the schema, justifying a score above the baseline 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 tool's purpose: 'List all available memory libraries with metadata.' It specifies the verb ('List'), resource ('memory libraries'), and scope ('all available'), distinguishing it from siblings like 'get_current_library_info' (which likely fetches a specific library) and 'switch_memory_library' (which changes context). However, it doesn't explicitly differentiate from 'list_system_json' or other list tools, keeping it at 4 rather than 5.

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

Usage Guidelines3/5

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

The description implies usage by stating it 'Shows all existing memory libraries,' suggesting it's for retrieving a comprehensive list. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_current_library_info' (for current library) or 'query_reasoning_memory' (for querying content). No exclusions or prerequisites are mentioned, leaving usage context inferred rather than clearly defined.

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

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/angrysky56/advanced-reasoning-mcp'

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