create_collection
Set up a new collection by specifying its name and properties to organize and manage threat modeling resources effectively within the Devici API framework.
Instructions
Create a new collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| name | Yes | ||
| other_properties | Yes |
Implementation Reference
- src/devici_mcp_server/server.py:68-77 (handler)The primary MCP tool handler for 'create_collection', registered via @mcp.tool() decorator. It prepares the collection data and delegates to the API client.@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)
- Supporting method in the API client that executes the 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)