get_threat
Retrieve detailed information about a specific threat by its unique ID, enabling efficient threat analysis and management within the Devici API ecosystem.
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'. Fetches a specific threat by ID from the Devici API via the client and returns it as a string.@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)
- API client helper method that performs the HTTP GET request to retrieve the specific threat from the Devici API.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 the API client that handles authenticated HTTP requests to the Devici API endpoints.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
- src/devici_mcp_server/server.py:15-15 (registration)Creation of the FastMCP server instance where all @mcp.tool() decorators register the tools, including get_threat.mcp = FastMCP("devici-mcp-server")