delete_dashboard
Removes a custom dashboard permanently from a project in the MCP Server for Coroot. Specify the project ID and dashboard ID to delete the dashboard.
Instructions
Delete a custom dashboard.
Permanently removes a dashboard from the project.
Args: project_id: Project ID dashboard_id: Dashboard ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dashboard_id | Yes | ||
| project_id | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1392-1402 (handler)MCP tool handler function for 'delete_dashboard', decorated with @mcp.tool(). This is the entry point executed when the tool is called.@mcp.tool() async def delete_dashboard(project_id: str, dashboard_id: str) -> dict[str, Any]: """Delete a custom dashboard. Permanently removes a dashboard from the project. Args: project_id: Project ID dashboard_id: Dashboard ID """ return await delete_dashboard_impl(project_id, dashboard_id) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1381-1389 (helper)Helper implementation that invokes the CorootClient.delete_dashboard method and handles the response formatting.async def delete_dashboard_impl(project_id: str, dashboard_id: str) -> dict[str, Any]: """Delete a dashboard.""" client = get_client() result = await client.delete_dashboard(project_id, dashboard_id) return { "success": True, "message": "Dashboard deleted successfully", "result": result, }
- src/mcp_coroot/client.py:1215-1252 (handler)Core handler in CorootClient that performs the actual HTTP POST request to delete the dashboard via the Coroot API.async def delete_dashboard( self, project_id: str, dashboard_id: str ) -> dict[str, Any]: """Delete a dashboard. Args: project_id: Project ID. dashboard_id: Dashboard ID. Returns: Deletion status. """ request_data = {"action": "delete"} response = await self._request( "POST", f"/api/project/{project_id}/dashboards/{dashboard_id}", json=request_data, ) # 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