create_dashboard
Generate custom dashboards for infrastructure monitoring by configuring panels and queries tailored to specific project needs using the MCP Server for Coroot.
Instructions
Create a new custom dashboard.
Creates a dashboard with custom panels and queries for monitoring specific aspects of your infrastructure.
Args: project_id: Project ID dashboard: Dashboard configuration with panels and layout
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dashboard | Yes | ||
| project_id | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1298-1307 (handler)The handler function that executes the core logic of the create_dashboard tool. It calls the CorootClient's create_dashboard method and wraps the response in a standard success format.async def create_dashboard_impl( project_id: str, dashboard: dict[str, Any] ) -> dict[str, Any]: """Create a new dashboard.""" result = await get_client().create_dashboard(project_id, dashboard) return { "success": True, "message": "Dashboard created successfully", "dashboard": result, }
- src/mcp_coroot/server.py:1310-1324 (registration)The FastMCP tool registration for 'create_dashboard', including the docstring that serves as the tool schema/documentation.@mcp.tool() async def create_dashboard( project_id: str, dashboard: dict[str, Any] ) -> dict[str, Any]: """Create a new custom dashboard. Creates a dashboard with custom panels and queries for monitoring specific aspects of your infrastructure. Args: project_id: Project ID dashboard: Dashboard configuration with panels and layout """ return await create_dashboard_impl(project_id, dashboard) # type: ignore[no-any-return]
- src/mcp_coroot/client.py:978-995 (helper)The CorootClient helper method that performs the actual HTTP POST request to the Coroot API to create the dashboard.async def create_dashboard( self, project_id: str, dashboard: dict[str, Any] ) -> dict[str, Any]: """Create a new custom dashboard. Args: project_id: Project ID. dashboard: Dashboard configuration. Returns: Created dashboard. """ response = await self._request( "POST", f"/api/project/{project_id}/dashboards", json=dashboard, ) return self._parse_json_response(response)