create_collection
Create a new collection to organize threat modeling resources within the Devici API, enabling structured management of threat models, components, and mitigations.
Instructions
Create a new collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| description | No | ||
| other_properties | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:68-77 (handler)The main MCP tool handler for 'create_collection'. It is decorated with @mcp.tool() for registration, processes input parameters into collection_data, calls the API client to create the collection, and returns the result as a string.@mcp.tool() async def create_collection(name: str, description: str = None, **other_properties) -> str: """Create a new collection""" async with create_client_from_env() as client: collection_data = {"name": name} if description: collection_data["description"] = description collection_data.update(other_properties) result = await client.create_collection(collection_data) return str(result)
- Helper method in the API client that performs the actual HTTP POST request to create a collection on the Devici API.async def create_collection(self, collection_data: Dict[str, Any]) -> Dict[str, Any]: """Create new collection.""" return await self._make_request("POST", "/collections", json_data=collection_data)