get_collections
Retrieve paginated collections from the Devici security platform to manage and organize threat models, components, and mitigations.
Instructions
Get collections from Devici with pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| page | No |
Implementation Reference
- src/devici_mcp_server/server.py:52-57 (handler)MCP tool handler and registration for 'get_collections'. This is the primary entry point for the tool, decorated with @mcp.tool(), which registers it and defines its execution logic by delegating to the API client.@mcp.tool() async def get_collections(limit: int = 20, page: int = 0) -> str: """Get collections from Devici with pagination""" async with create_client_from_env() as client: result = await client.get_collections(limit=limit, page=page) return str(result)
- Core implementation of get_collections in the DeviciAPIClient class. Performs the HTTP GET request to the '/collections/' endpoint with pagination parameters using the shared _make_request helper.async def get_collections(self, limit: int = 20, page: int = 0) -> Dict[str, Any]: """Get all collections.""" params = {"limit": limit, "page": page} return await self._make_request("GET", "/collections/", params=params)