Skip to main content
Glama

delete_project

Remove a project from Basic Memory's configuration and database records. This action deletes project references but preserves the actual files on disk.

Instructions

Delete a Basic Memory project.

Removes a project from the configuration and database. This does NOT delete the actual files on disk - only removes the project from Basic Memory's configuration and database records.

Args: project_name: Name of the project to delete

Returns: Confirmation message about project deletion

Example: delete_project("old-project")

Warning: This action cannot be undone. The project will need to be re-added to access its content through Basic Memory again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'delete_project' MCP tool. It validates the project exists, calls the API to delete it using its external_id, and returns a confirmation message. The @mcp.tool() decorator registers the tool with the FastMCP server instance and infers the input schema from the function signature (project_name: str) and docstring.
    @mcp.tool()
    async def delete_project(project_name: str, context: Context | None = None) -> str:
        """Delete a Basic Memory project.
    
        Removes a project from the configuration and database. This does NOT delete
        the actual files on disk - only removes the project from Basic Memory's
        configuration and database records.
    
        Args:
            project_name: Name of the project to delete
    
        Returns:
            Confirmation message about project deletion
    
        Example:
            delete_project("old-project")
    
        Warning:
            This action cannot be undone. The project will need to be re-added
            to access its content through Basic Memory again.
        """
        track_mcp_tool("delete_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 deletion disabled - MCP server is constrained to project '{constrained_project}'.\nUse the CLI to delete projects: `basic-memory project remove \"{project_name}\"`"
    
            if context:  # pragma: no cover
                await context.info(f"Deleting project: {project_name}")
    
            # Get project info before deletion to validate it exists
            response = await call_get(client, "/projects/projects")
            project_list = ProjectList.model_validate(response.json())
    
            # Find the project by permalink (derived from name).
            # Note: The API response uses `ProjectItem` which derives `permalink` from `name`,
            # so a separate case-insensitive name match would be redundant here.
            project_permalink = generate_permalink(project_name)
            target_project = None
            for p in project_list.projects:
                # Match by permalink (handles case-insensitive input)
                if p.permalink == project_permalink:
                    target_project = p
                    break
    
            if not target_project:
                available_projects = [p.name for p in project_list.projects]
                raise ValueError(
                    f"Project '{project_name}' not found. Available projects: {', '.join(available_projects)}"
                )
    
            # Call v2 API to delete project using project external_id
            response = await call_delete(client, f"/v2/projects/{target_project.external_id}")
            status_response = ProjectStatusResponse.model_validate(response.json())
    
            result = f"✓ {status_response.message}\n\n"
    
            if status_response.old_project:
                result += "Removed project details:\n"
                result += f"• Name: {status_response.old_project.name}\n"
                if hasattr(status_response.old_project, "path"):
                    result += f"• Path: {status_response.old_project.path}\n"
    
            result += "Files remain on disk but project is no longer tracked by Basic Memory.\n"
            result += "Re-add the project to access its content again.\n"
    
            return result
  • Re-export of the delete_project function from project_management.py, which triggers the decorator registration when this __init__.py is imported.
    from basic_memory.mcp.tools.project_management import (
        list_memory_projects,
        create_memory_project,
        delete_project,
    )
  • Creation of the global FastMCP server instance 'mcp' to which tools are registered via decorators.
    mcp = FastMCP(
        name="Basic Memory",
        lifespan=lifespan,
    )
Behavior5/5

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

With no annotations provided, the description carries full burden and does an excellent job. It discloses critical behavioral traits: that this is a destructive operation ('cannot be undone'), clarifies what gets affected (configuration and database records but NOT files on disk), and explains the consequence (project would need re-adding to access content).

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 well-structured with clear sections (Args, Returns, Example, Warning) and front-loaded with the core purpose. Every sentence adds value: the first states what it does, the second clarifies scope, and subsequent sections provide practical guidance without redundancy.

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

Completeness5/5

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

For a destructive tool with no annotations, 0% schema coverage, but with output schema present, the description is remarkably complete. It covers purpose, behavioral implications, parameter meaning, example usage, and warnings - providing everything needed for safe invocation despite minimal structured data support.

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?

With 0% schema description coverage and only one parameter, the description fully compensates by explaining the 'project_name' parameter meaning ('Name of the project to delete') in the Args section. It provides essential semantic context that the schema lacks entirely.

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 ('Delete a Basic Memory project') and distinguishes it from sibling tools like 'create_memory_project' and 'list_memory_projects'. It explicitly mentions what resource is affected ('project') and what system it operates on ('Basic Memory').

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 about when to use this tool (to remove a project from configuration/database) and includes a warning about irreversibility. However, it doesn't explicitly mention when NOT to use it or name specific alternatives among siblings like 'delete_note' for different operations.

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