get_collections
Retrieve paginated collections from Devici to manage threat modeling resources, supporting limit and page parameters for controlled access.
Instructions
Get collections from Devici with pagination
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_collections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| page | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:52-57 (handler)MCP tool handler for get_collections, decorated with @mcp.tool(). Creates a Devici API client and calls its get_collections method to fetch paginated collections.
@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) - Helper method in DeviciAPIClient that makes a GET request to /collections/ endpoint with pagination parameters to retrieve collections data.
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)