get_threat
Retrieve detailed information about a specific security threat using its unique identifier. This tool helps security teams access threat data for analysis and response.
Instructions
Get a specific threat by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threat_id | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:154-159 (handler)MCP tool handler for 'get_threat': decorated with @mcp.tool(), accepts threat_id (str), fetches the threat via API client, converts result to string and returns it.@mcp.tool() async def get_threat(threat_id: str) -> str: """Get a specific threat by ID""" async with create_client_from_env() as client: result = await client.get_threat(threat_id) return str(result)
- Supporting API client method that executes the HTTP GET request to '/threats/{threat_id}' to retrieve threat details.async def get_threat(self, threat_id: str) -> Dict[str, Any]: """Get specific threat by ID.""" return await self._make_request("GET", f"/threats/{threat_id}")
- Core helper method in API client for making authenticated HTTP requests to the Devici API, used by get_threat.async def _make_request( self, method: str, endpoint: str, params: Optional[Dict[str, Any]] = None, json_data: Optional[Dict[str, Any]] = None ) -> Dict[str, Any]: """Make authenticated request to Devici API.""" if not self.access_token: await self.authenticate() try: response = await self.client.request( method=method, url=endpoint, params=params, json=json_data ) response.raise_for_status() return response.json() except httpx.HTTPError as e: logger.error(f"API request failed: {method} {endpoint} - {e}") raise