Skip to main content
Glama

get_panel_data

Retrieve dashboard panel data within a custom dashboard, including metrics, time series, or aggregated values, using project, dashboard, and panel IDs.

Instructions

Get data for a specific dashboard panel.

Retrieves the data that powers a specific panel in a custom dashboard, including metrics, time series data, or aggregated values.

Args: project_id: The project ID dashboard_id: The dashboard ID panel_id: The panel ID within the dashboard from_time: Optional start time (ISO format or relative like '-1h') to_time: Optional end time (ISO format or 'now')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dashboard_idYes
from_timeNo
panel_idYes
project_idYes
to_timeNo

Implementation Reference

  • Core handler function that implements the get_panel_data tool logic by preparing parameters and calling the CorootClient.get_panel_data method.
    async def get_panel_data_impl( project_id: str, dashboard_id: str, panel_id: str, from_time: str | None = None, to_time: str | None = None, ) -> dict[str, Any]: """Implementation for get_panel_data tool.""" try: client = get_client() params = {} if from_time: params["from"] = from_time if to_time: params["to"] = to_time data = await client.get_panel_data(project_id, dashboard_id, panel_id, params) return {"success": True, "data": data} except ValueError as e: return {"success": False, "error": str(e)} except Exception as e: return {"success": False, "error": f"Unexpected error: {str(e)}"}
  • MCP tool registration using @mcp.tool() decorator, defining input schema via parameters and comprehensive docstring.
    @mcp.tool() async def get_panel_data( project_id: str, dashboard_id: str, panel_id: str, from_time: str | None = None, to_time: str | None = None, ) -> dict[str, Any]: """ Get data for a specific dashboard panel. Retrieves the data that powers a specific panel in a custom dashboard, including metrics, time series data, or aggregated values. Args: project_id: The project ID dashboard_id: The dashboard ID panel_id: The panel ID within the dashboard from_time: Optional start time (ISO format or relative like '-1h') to_time: Optional end time (ISO format or 'now') """ return await get_panel_data_impl( project_id, dashboard_id, panel_id, from_time, to_time )
  • Supporting client method in CorootClient that performs the actual HTTP GET request to the Coroot API endpoint /api/project/{project_id}/panel/data.
    async def get_panel_data( self, project_id: str, dashboard_id: str, panel_id: str, params: dict[str, Any] | None = None, ) -> dict[str, Any]: """Get data for a specific dashboard panel. Args: project_id: The project ID dashboard_id: The dashboard ID panel_id: The panel ID params: Optional query parameters (time range, etc.) Returns: Dict containing panel data """ query_params = params or {} query_params.update({"dashboard": dashboard_id, "panel": panel_id}) response = await self._request( "GET", f"/api/project/{project_id}/panel/data", params=query_params ) data: dict[str, Any] = response.json() return data

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