get_threats_by_component
Identify security threats associated with a specific component in threat models to assess vulnerabilities and prioritize mitigation actions.
Instructions
Get threats for a specific component
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component_id | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:162-167 (handler)The main MCP tool handler for 'get_threats_by_component'. It uses @mcp.tool() decorator for registration, creates an API client from environment variables, calls the client's method to fetch threats by component ID, and returns the JSON stringified result.@mcp.tool() async def get_threats_by_component(component_id: str) -> str: """Get threats for a specific component""" async with create_client_from_env() as client: result = await client.get_threats_by_component(component_id) return str(result)
- Supporting helper method in the DeviciAPIClient class that makes the actual HTTP GET request to the '/threats/component/{component_id}' API endpoint to retrieve threats associated with the component.async def get_threats_by_component(self, component_id: str) -> Dict[str, Any]: """Get all threats for specific component.""" return await self._make_request("GET", f"/threats/component/{component_id}")