get_collection
Retrieve a specific collection by its unique ID to access organized threat model data within the Devici security platform.
Instructions
Get a specific collection by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:60-66 (handler)The main MCP tool handler for 'get_collection'. It creates an API client context, calls the client's get_collection method with the provided collection_id, and returns the result as a string.@mcp.tool() async def get_collection(collection_id: str) -> str: """Get a specific collection by ID""" async with create_client_from_env() as client: result = await client.get_collection(collection_id) return str(result)
- Helper method in the API client that performs the actual HTTP GET request to retrieve the specific collection by ID from the Devici API.async def get_collection(self, collection_id: str) -> Dict[str, Any]: """Get specific collection by ID.""" return await self._make_request("GET", f"/collections/{collection_id}")
- src/devici_mcp_server/server.py:60-60 (registration)The @mcp.tool() decorator registers the get_collection function as an MCP tool.@mcp.tool()
- Factory function to create the DeviciAPIClient instance from environment variables, used in the handler.def create_client_from_env() -> DeviciAPIClient: