get_collections
Retrieve paginated collections from Devici for managing threat models, security components, and mitigations through the Devici API.
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)The primary handler function for the MCP tool 'get_collections'. It is registered via the @mcp.tool() decorator and delegates to the API client's get_collections method to fetch paginated collections from the Devici API, returning the result as a string.@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)
- Supporting helper method in the DeviciAPIClient class that makes the authenticated HTTP GET request to the '/collections/' endpoint with pagination parameters to retrieve collections.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)