delete_project
Remove a project and its associated data permanently from the MCP Server for Coroot. Specifies the project ID for deletion. Warning: This action is irreversible, so use with caution.
Instructions
Delete a project and all associated data.
WARNING: This action is irreversible and will delete all project data.
Args: project_id: Project ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- src/mcp_coroot/client.py:1129-1156 (handler)Core handler method in CorootClient that executes the DELETE API request to delete the specified project and handles various response scenarios.async def delete_project(self, project_id: str) -> dict[str, Any]: """Delete a project. Args: project_id: Project ID. Returns: Deletion status. """ response = await self._request("DELETE", f"/api/project/{project_id}") # Handle empty response (204 or empty body) if response.status_code == 204: return {"status": "deleted"} # Try to parse JSON response try: content = response.text.strip() if not content: # Empty response body with 200 status return {"status": "deleted"} data: dict[str, Any] = response.json() return data except Exception: # If parsing fails, assume success if status code is 2xx if 200 <= response.status_code < 300: return {"status": "deleted"} raise
- src/mcp_coroot/server.py:1502-1511 (registration)MCP tool registration using @mcp.tool() decorator, which defines the tool interface and delegates to the implementation.@mcp.tool() async def delete_project(project_id: str) -> dict[str, Any]: """Delete a project and all associated data. WARNING: This action is irreversible and will delete all project data. Args: project_id: Project ID """ return await delete_project_impl(project_id) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1492-1499 (helper)Helper implementation that calls the client handler, wraps the result in a standard response format, and applies error handling via decorator.async def delete_project_impl(project_id: str) -> dict[str, Any]: """Delete a project.""" result = await get_client().delete_project(project_id) return { "success": True, "message": f"Project {project_id} deleted successfully", "result": result, }