get_threats
Retrieve paginated threat data from Devici's threat modeling platform to analyze security risks.
Instructions
Get threats from Devici with pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| page | No |
Implementation Reference
- src/devici_mcp_server/server.py:146-151 (handler)The main handler function for the 'get_threats' MCP tool. It is registered via the @mcp.tool() decorator and executes the tool logic by calling the API client.@mcp.tool() async def get_threats(limit: int = 20, page: int = 0) -> str: """Get threats from Devici with pagination""" async with create_client_from_env() as client: result = await client.get_threats(limit=limit, page=page) return str(result)
- Supporting API client method that performs the actual HTTP request to retrieve threats from the Devici API, called by the MCP tool handler.async def get_threats(self, limit: int = 20, page: int = 0) -> Dict[str, Any]: """Get all threats.""" params = {"limit": limit, "page": page} return await self._make_request("GET", "/threats/", params=params)
- src/devici_mcp_server/server.py:146-151 (registration)The @mcp.tool() decorator registers this function as the 'get_threats' tool in the FastMCP server.@mcp.tool() async def get_threats(limit: int = 20, page: int = 0) -> str: """Get threats from Devici with pagination""" async with create_client_from_env() as client: result = await client.get_threats(limit=limit, page=page) return str(result)