get_collections
Retrieve paginated collections from the Devici API using this tool. Specify page and limit parameters to manage and access threat modeling resources efficiently.
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-58 (handler)MCP tool handler for 'get_collections'. This is the main execution function registered with @mcp.tool(), which creates an API client and calls the underlying get_collections method, returning the result as 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)
- The API client method implementing the actual HTTP request to fetch collections from the Devici API, called by the MCP handler.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)