Skip to main content
Glama
jamesbrink

MCP Server for Coroot

delete_dashboard

Remove custom dashboards from Coroot projects to manage monitoring interfaces and maintain organized performance tracking environments.

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
NameRequiredDescriptionDefault
project_idYes
dashboard_idYes

Implementation Reference

  • Core implementation of dashboard deletion: sends POST request to Coroot API /api/project/{project_id}/dashboards/{dashboard_id} with {"action": "delete"} and handles various response types.
    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
  • MCP tool registration for 'delete_dashboard' using FastMCP @mcp.tool() decorator. This defines the tool schema via parameters and docstring, and points to the implementation.
    @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]
  • MCP server wrapper handler that calls the CorootClient.delete_dashboard method, handles errors via @handle_errors decorator, and formats the success response.
    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,
        }

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/jamesbrink/mcp-coroot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server