delete_project
Delete a project and all associated data permanently. Provide the project ID to remove the project and its resources.
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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_coroot/server.py:1492-1499 (handler)The implementation function (handler) for the delete_project tool. It calls the client's delete_project method and returns a success response.
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, } - src/mcp_coroot/server.py:1502-1511 (registration)The @mcp.tool() registration of 'delete_project' as an MCP tool. The docstring serves as the tool's schema/description.
@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/client.py:1129-1156 (helper)The low-level HTTP client method that performs the actual DELETE request to the Coroot API. Handles various response scenarios (204, empty body, JSON, errors).
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