get_dashboard_data
Retrieve dashboard data for specific chart types to visualize threat modeling metrics, supporting pagination, date ranges, and project filtering.
Instructions
Get dashboard data for a specific chart type
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chart_type": "<chart_type>"
},
"name": "get_dashboard_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chart_type | Yes | ||
| limit | No | ||
| page | No | ||
| start | No | ||
| end | No | ||
| project_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:221-233 (handler)MCP tool handler function for 'get_dashboard_data'. Registered via @mcp.tool() decorator. Fetches dashboard data by calling the API client.
@mcp.tool() async def get_dashboard_data(chart_type: str, limit: int = 20, page: int = 0, start: str = None, end: str = None, project_id: str = None) -> str: """Get dashboard data for a specific chart type""" async with create_client_from_env() as client: result = await client.get_dashboard_data( chart_type=chart_type, limit=limit, page=page, start=start, end=end, project_id=project_id ) return str(result) - Helper method in DeviciAPIClient that constructs API parameters and makes authenticated GET request to /dashboard/ endpoint to retrieve the data.
async def get_dashboard_data( self, chart_type: str, limit: int = 20, page: int = 0, start: Optional[str] = None, end: Optional[str] = None, project_id: Optional[str] = None ) -> List[Dict[str, Any]]: """Get dashboard data by specific chart type.""" params = { "limit": limit, "page": page, "type": chart_type } if start: params["start"] = start if end: params["end"] = end if project_id: params["projectId"] = project_id return await self._make_request("GET", "/dashboard/", params=params) - src/devici_mcp_server/server.py:221-221 (registration)The @mcp.tool() decorator registers the get_dashboard_data function as an MCP tool.
@mcp.tool()