Skip to main content
Glama
drdee

Memory MCP

by drdee

list_memories

Retrieve all stored memories from the Memory MCP server to manage and organize data efficiently.

Instructions

List all stored memories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'list_memories' MCP tool. It calls the database manager to fetch all memories and formats them into a human-readable string response.
    def list_memories() -> str:
        """
        List all stored memories.
    
        Returns:
            A formatted list of all memories with ID and title
        """
        try:
            memories = db.list_memories()
            if not memories:
                return "No memories stored yet."
    
            result = "Stored Memories:\n\n"
            for memory in memories:
                result += f"ID: {memory['id']} - {memory['title']}\n"
            return result
        except Exception as e:
            return f"Error listing memories: {str(e)}"
  • Registration of the 'list_memories' tool in the server's list_tools() method, including name, description, and input schema.
    types.Tool(
        name="list_memories",
        description="List all stored memories.",
        inputSchema={
            "type": "object",
            "properties": {},
            "title": "listMemoriesArguments",
        },
    ),
  • The input schema for the 'list_memories' tool, defining an empty object since no parameters are required.
    inputSchema={
        "type": "object",
        "properties": {},
        "title": "listMemoriesArguments",
    },
  • DatabaseManager helper method that queries the SQLite database for all memories, returning a list of id-title dicts used by the tool handler.
    def list_memories(self) -> List[Dict[str, Any]]:
        """Get a list of all memories with basic information."""
        if not self.conn:
            self.initialize_db()
    
        if self.conn is None:
            raise RuntimeError("Database connection not available")
    
        cursor = self.conn.execute("SELECT id, title FROM memories")
        return [{"id": row[0], "title": row[1]} for row in cursor.fetchall()]
  • Dispatch handler in the server's call_tool() method that invokes the list_memories tool function and wraps the result in TextContent.
    elif name == "list_memories":
        result = list_memories()
        return [types.TextContent(type="text", text=result)]
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 'List all stored memories,' which implies a read-only operation, but doesn't clarify aspects like pagination, sorting, filtering, or what 'all' entails (e.g., if there are limits). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 'List all stored memories' is a single, efficient sentence that front-loads the core action and resource. It wastes no words and is appropriately sized for a simple tool, earning the highest score for conciseness.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior (e.g., output format, limitations) that would be helpful for an agent. Without annotations or output schema, more context is needed for full completeness.

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 the schema fully documents the absence of inputs. The description doesn't add parameter details, but since there are no parameters, a baseline of 4 is appropriate—it's clear no inputs are needed, though a perfect score would require explicit confirmation of this in the description.

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 'List all stored memories' clearly states the verb ('List') and resource ('stored memories'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_memory' (which likely retrieves a specific memory) or 'remember' (which likely creates a memory), so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. Given siblings like 'get_memory' (for specific retrieval) and 'delete_memory'/'update_memory' (for modifications), the agent must infer usage from the name alone, which is insufficient for optimal tool selection.

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/drdee/memory-mcp'

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