Skip to main content
Glama

List Memories

list_memories
Read-only

Retrieve available memory entries from the Serena MCP server to access stored information for coding tasks.

Instructions

List available memories. Any memory can be read using the read_memory tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the MCP tool handler for "list_memories". The apply method retrieves the list of memories from the project's memories_manager and serializes it to JSON.
    class ListMemoriesTool(Tool):
        """
        Lists memories in Serena's project-specific memory store.
        """
    
        def apply(self) -> str:
            """
            List available memories. Any memory can be read using the `read_memory` tool.
            """
            return self._to_json(self.memories_manager.list_memories())
  • Core utility method in MemoriesManager that lists the names of memory files (stripping .md extension) in the project's memories directory.
    def list_memories(self) -> list[str]:
        return [f.name.replace(".md", "") for f in self._memory_dir.iterdir() if f.is_file()]
  • Class method that derives the MCP tool name 'list_memories' from the class name 'ListMemoriesTool'.
    @classmethod
    def get_name_from_cls(cls) -> str:
        name = cls.__name__
        if name.endswith("Tool"):
            name = name[:-4]
        # convert to snake_case
        name = "".join(["_" + c.lower() if c.isupper() else c for c in name]).lstrip("_")
        return name
  • ToolRegistry discovers all Tool subclasses (including ListMemoriesTool) via iter_subclasses and registers them by name.
    for cls in iter_subclasses(Tool):
        if not any(cls.__module__.startswith(pkg) for pkg in tool_packages):
            continue
        is_optional = issubclass(cls, ToolMarkerOptional)
        name = cls.get_name_from_cls()
        if name in self._tool_dict:
            raise ValueError(f"Duplicate tool name found: {name}. Tool classes must have unique names.")
        self._tool_dict[name] = RegisteredTool(tool_class=cls, is_optional=is_optional, tool_name=name)
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the agent knows this is a safe read operation. The description adds no behavioral traits beyond this, such as pagination, sorting, or access constraints, relying entirely on annotations for safety disclosure.

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 extremely concise with two sentences that are front-loaded and waste-free. Every word contributes to understanding the tool's purpose and usage, making it efficient and well-structured.

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, read-only, non-destructive) and the presence of annotations and an output schema, the description is complete enough for basic use. It could benefit from more detail on output format or limitations, but the essentials are covered.

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?

With 0 parameters and 100% schema description coverage, the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and its mention of 'available memories' implies no filtering, which aligns with the empty schema. Baseline is 4 for zero parameters.

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 with a specific verb ('List') and resource ('memories'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'read_memory' beyond mentioning it as a follow-up action, missing direct comparison.

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

Usage Guidelines4/5

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

The description provides clear context by stating that listed memories can be read with 'read_memory', implying usage as a precursor to that tool. It doesn't specify when not to use it or alternatives, but the guidance is sufficient for basic navigation.

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/oraios/serena'

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