Skip to main content
Glama

create_memory_project

Create a new knowledge management project with a unique name and storage path to organize semantic data in Markdown files.

Instructions

Create a new Basic Memory project.

Creates a new project with the specified name and path. The project directory will be created if it doesn't exist. Optionally sets the new project as default.

Args: project_name: Name for the new project (must be unique) project_path: File system path where the project will be stored set_default: Whether to set this project as the default (optional, defaults to False)

Returns: Confirmation message with project details

Example: create_memory_project("my-research", "~/Documents/research") create_memory_project("work-notes", "/home/user/work", set_default=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYes
project_pathYes
set_defaultNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'create_memory_project' tool, decorated with @mcp.tool(). It creates a new Basic Memory project by calling the internal API, handles constrained project mode, and returns formatted confirmation.
    @mcp.tool("create_memory_project")
    async def create_memory_project(
        project_name: str, project_path: str, set_default: bool = False, context: Context | None = None
    ) -> str:
        """Create a new Basic Memory project.
    
        Creates a new project with the specified name and path. The project directory
        will be created if it doesn't exist. Optionally sets the new project as default.
    
        Args:
            project_name: Name for the new project (must be unique)
            project_path: File system path where the project will be stored
            set_default: Whether to set this project as the default (optional, defaults to False)
    
        Returns:
            Confirmation message with project details
    
        Example:
            create_memory_project("my-research", "~/Documents/research")
            create_memory_project("work-notes", "/home/user/work", set_default=True)
        """
        track_mcp_tool("create_memory_project")
        async with get_client() as client:
            # Check if server is constrained to a specific project
            constrained_project = os.environ.get("BASIC_MEMORY_MCP_PROJECT")
            if constrained_project:
                return f'# Error\n\nProject creation disabled - MCP server is constrained to project \'{constrained_project}\'.\nUse the CLI to create projects: `basic-memory project add "{project_name}" "{project_path}"`'
    
            if context:  # pragma: no cover
                await context.info(f"Creating project: {project_name} at {project_path}")
    
            # Create the project request
            project_request = ProjectInfoRequest(
                name=project_name, path=project_path, set_default=set_default
            )
    
            # Call API to create project
            response = await call_post(client, "/projects/projects", json=project_request.model_dump())
            status_response = ProjectStatusResponse.model_validate(response.json())
    
            result = f"✓ {status_response.message}\n\n"
    
            if status_response.new_project:
                result += "Project Details:\n"
                result += f"• Name: {status_response.new_project.name}\n"
                result += f"• Path: {status_response.new_project.path}\n"
    
                if set_default:
                    result += "• Set as default project\n"
    
            result += "\nProject is now available for use in tool calls.\n"
            result += f"Use '{project_name}' as the project parameter in MCP tool calls.\n"
    
            return result
  • Re-exports the create_memory_project function from project_management.py, allowing easy import from basic_memory.mcp.tools in tests and other modules. Importing this module registers all tools via their decorators.
    from basic_memory.mcp.tools.project_management import (
        list_memory_projects,
        create_memory_project,
        delete_project,
    )
  • Imports Pydantic models used internally for project creation request/response validation: ProjectInfoRequest for input to API, ProjectStatusResponse for output parsing, and ProjectList for listing.
    from basic_memory.schemas.project_info import (
        ProjectList,
        ProjectStatusResponse,
        ProjectInfoRequest,
    )
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. It discloses that the project directory will be created if missing and mentions the optional default-setting behavior, which adds useful context beyond just the creation action. However, it doesn't cover potential errors, permissions needed, or what happens with existing projects.

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?

Well-structured with clear sections (description, args, returns, example) and front-loaded purpose. The example section is helpful but slightly lengthens the description. Most sentences earn their place, though some formatting could be tighter.

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 3 parameters with 0% schema coverage and no annotations, the description does an excellent job explaining parameters and includes an output schema (returns confirmation message). It covers the core creation behavior well, though additional context about error conditions or relationships to other tools would make it more complete.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It provides clear semantic explanations for all three parameters: project_name (must be unique), project_path (file system path where stored), and set_default (optional default behavior). This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Create a new Basic Memory project') and resource ('project'), distinguishing it from sibling tools like 'list_memory_projects' or 'delete_project'. It specifies the exact operation rather than being vague or tautological.

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?

No explicit guidance on when to use this tool versus alternatives is provided. While it's clear this creates projects, there's no mention of prerequisites, when creation might fail, or how it relates to other project management tools in the sibling list.

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