remove_project_tool
Remove a registered project from the MCP server-tree-sitter by specifying its name. This tool ensures proper context management for code analysis operations by disassociating the project.
Instructions
Remove a registered project.
Args:
name: Project name
Returns:
Success message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- The handler function for the 'remove_project_tool' MCP tool. It removes the specified project using the project_registry and returns a success message or raises an error.@mcp_server.tool() def remove_project_tool(name: str) -> Dict[str, str]: """Remove a registered project. Args: name: Project name Returns: Success message """ try: project_registry.remove_project(name) return {"status": "success", "message": f"Project '{name}' removed"} except Exception as e: raise ProjectError(f"Failed to remove project: {e}") from e
- src/mcp_server_tree_sitter/server.py:152-155 (registration)The registration of all MCP tools, including 'remove_project_tool', via the register_tools function call in the main server initialization.from .tools.registration import register_tools register_capabilities(mcp) register_tools(mcp, container)
- The core helper method in ProjectRegistry that removes a project from the internal projects dictionary, used by the tool handler.def remove_project(self, name: str) -> None: """ Remove a project. Args: name: Project name Raises: ProjectError: If project doesn't exist """ with self._global_lock: if name not in self._projects: raise ProjectError(f"Project '{name}' not found") del self._projects[name]