Skip to main content
Glama

get_threat_models

Retrieve threat models from Devici with pagination controls to manage and analyze security risks systematically.

Instructions

Get threat models from Devici with pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
pageNo

Implementation Reference

  • The primary MCP tool handler for 'get_threat_models'. This function is decorated with @mcp.tool(), registering it as an MCP tool. It creates an API client and delegates to the client's get_threat_models method, returning the result as a string.
    @mcp.tool() async def get_threat_models(limit: int = 20, page: int = 0) -> str: """Get threat models from Devici with pagination""" async with create_client_from_env() as client: result = await client.get_threat_models(limit=limit, page=page) return str(result)
  • The API client helper method that implements the core logic for fetching threat models from the Devici API via an authenticated GET request to '/threat-models/' endpoint.
    async def get_threat_models(self, limit: int = 20, page: int = 0) -> Dict[str, Any]: """Get all threat models.""" params = {"limit": limit, "page": page} return await self._make_request("GET", "/threat-models/", params=params)
  • Factory function used by the handler to create and configure the DeviciAPIClient from environment variables.
    def create_client_from_env() -> DeviciAPIClient: """Create API client from environment variables.""" config = DeviciConfig( api_base_url=os.getenv("DEVICI_API_BASE_URL", "https://api.devici.com/api/v1"), client_id=os.getenv("DEVICI_CLIENT_ID", ""), client_secret=os.getenv("DEVICI_CLIENT_SECRET", ""), debug=os.getenv("DEBUG", "false").lower() == "true" ) if not config.client_id or not config.client_secret: raise ValueError("DEVICI_CLIENT_ID and DEVICI_CLIENT_SECRET must be set") return DeviciAPIClient(config)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/geoffwhittington/devici-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server