get_threat_models_by_collection
Retrieve threat models from a specific collection to analyze security risks and manage threat modeling resources.
Instructions
Get threat models for a specific collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | ||
| limit | No | ||
| page | No |
Implementation Reference
- src/devici_mcp_server/server.py:89-94 (handler)MCP tool handler function decorated with @mcp.tool(). It creates an API client instance, calls the client's get_threat_models_by_collection method, and returns the result as a string. This is the core execution logic for the tool.@mcp.tool() async def get_threat_models_by_collection(collection_id: str, limit: int = 20, page: int = 0) -> str: """Get threat models for a specific collection""" async with create_client_from_env() as client: result = await client.get_threat_models_by_collection(collection_id, limit=limit, page=page) return str(result)
- API client method that constructs the HTTP GET request to the Devici API endpoint /threat-models/collection/{collection_id} with pagination parameters and handles the response.async def get_threat_models_by_collection(self, collection_id: str, limit: int = 20, page: int = 0) -> Dict[str, Any]: """Get all threat models by collection.""" params = {"limit": limit, "page": page} return await self._make_request("GET", f"/threat-models/collection/{collection_id}", params=params)
- src/devici_mcp_server/server.py:89-89 (registration)The @mcp.tool() decorator registers the get_threat_models_by_collection function as an MCP tool on the FastMCP server instance.@mcp.tool()