create_collection
Create a new collection in the Devici MCP Server to organize threat models, security components, and mitigations for structured security management.
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'. Decorated with @mcp.tool() to register it. Constructs collection data from parameters 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)
- Helper method in DeviciAPIClient that performs the actual HTTP POST request to the /collections endpoint to create a new collection.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)
- src/devici_mcp_server/server.py:9-9 (helper)Import of create_client_from_env used in the handler to obtain an authenticated API client instance.from .api_client import create_client_from_env