Skip to main content
Glama

list_memory_projects

Discover available knowledge projects in your Basic Memory system to identify which project to use for MCP operations. Shows project status and provides session management guidance.

Instructions

List all available projects with their status.

Shows all Basic Memory projects that are available for MCP operations. Use this tool to discover projects when you need to know which project to use.

Use this tool:

  • At conversation start when project is unknown

  • When user asks about available projects

  • Before any operation requiring a project

After calling:

  • Ask user which project to use

  • Remember their choice for the session

Returns: Formatted list of projects with session management guidance

Example: list_memory_projects()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main execution logic for the list_memory_projects MCP tool. Fetches project list from internal API, handles constrained mode, and returns formatted string response.
    @mcp.tool("list_memory_projects")
    async def list_memory_projects(context: Context | None = None) -> str:
        """List all available projects with their status.
    
        Shows all Basic Memory projects that are available for MCP operations.
        Use this tool to discover projects when you need to know which project to use.
    
        Use this tool:
        - At conversation start when project is unknown
        - When user asks about available projects
        - Before any operation requiring a project
    
        After calling:
        - Ask user which project to use
        - Remember their choice for the session
    
        Returns:
            Formatted list of projects with session management guidance
    
        Example:
            list_memory_projects()
        """
        track_mcp_tool("list_memory_projects")
        async with get_client() as client:
            if context:  # pragma: no cover
                await context.info("Listing all available projects")
    
            # Check if server is constrained to a specific project
            constrained_project = os.environ.get("BASIC_MEMORY_MCP_PROJECT")
    
            # Get projects from API
            response = await call_get(client, "/projects/projects")
            project_list = ProjectList.model_validate(response.json())
    
            if constrained_project:
                result = f"Project: {constrained_project}\n\n"
                result += "Note: This MCP server is constrained to a single project.\n"
                result += "All operations will automatically use this project."
            else:
                # Show all projects with session guidance
                result = "Available projects:\n"
    
                for project in project_list.projects:
                    result += f"• {project.name}\n"
    
                result += "\n" + "─" * 40 + "\n"
                result += "Next: Ask which project to use for this session.\n"
                result += "Example: 'Which project should I use for this task?'\n\n"
                result += "Session reminder: Track the selected project for all subsequent operations in this conversation.\n"
                result += "The user can say 'switch to [project]' to change projects."
    
            return result
  • Pydantic model ProjectList used by the tool to validate and parse the JSON response from the /projects/projects API endpoint.
    class ProjectList(BaseModel):
        """Response model for listing projects."""
    
        projects: List[ProjectItem]
        default_project: str
  • Import of the list_memory_projects handler function into the tools module, which triggers registration via the @mcp.tool decorator.
    from basic_memory.mcp.tools.project_management import (
        list_memory_projects,
        create_memory_project,
        delete_project,
    )
Behavior4/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 effectively describes the tool's behavior: it lists projects with status, is used for discovery, and includes session management guidance. However, it doesn't mention potential limitations like rate limits, error conditions, or whether the list is paginated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage guidelines, post-call instructions, returns, example). It's front-loaded with the core purpose. Some sentences could be more concise (e.g., 'Shows all Basic Memory projects...' slightly repeats the first sentence), but overall it's efficient and informative.

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 annotations), the description is quite complete. It explains purpose, usage, and behavioral aspects. Since an output schema exists, it doesn't need to detail return values, though it mentions 'Formatted list of projects with session management guidance,' which adds helpful context. Minor gaps include lack of error handling or performance details.

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 doesn't discuss parameters, focusing instead on usage and output. A baseline of 4 is applied since there are no parameters to document.

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 projects with their status' and 'Shows all Basic Memory projects that are available for MCP operations.' It specifies the verb (list/show) and resource (projects), but doesn't explicitly differentiate from sibling tools like 'list_directory' or 'search_notes' that might also list resources.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'At conversation start when project is unknown,' 'When user asks about available projects,' and 'Before any operation requiring a project.' It also includes post-call instructions ('Ask user which project to use,' 'Remember their choice for the session'), which effectively guides usage context.

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/basicmachines-co/basic-memory'

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