cosmosdb_container_delete
Delete a Cosmos DB container by specifying its name and optional database. Ensures automatic logging and audit tracking of the deletion process.
Instructions
Delete a Cosmos DB container
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_name | Yes | Name of the Cosmos DB container | |
| database_name | No | Name of the Cosmos DB database (optional, defaults to 'defaultdb') |
Input Schema (JSON Schema)
{
"properties": {
"container_name": {
"description": "Name of the Cosmos DB container",
"type": "string"
},
"database_name": {
"description": "Name of the Cosmos DB database (optional, defaults to 'defaultdb')",
"type": "string"
}
},
"required": [
"container_name"
],
"type": "object"
}
Implementation Reference
- mcp_server_azure/azure_server.py:263-265 (handler)Executes the deletion of the specified Cosmos DB container using the Azure Cosmos DB client's database.delete_container method and sets a success response.elif name == "cosmosdb_container_delete": # Renamed from table to container database.delete_container(arguments["container_name"]) response = {"container_name": arguments["container_name"], "deleted": True}
- Defines the tool's metadata, description, and input schema which validates the required 'container_name' and optional 'database_name' parameters.Tool( name="cosmosdb_container_delete", # Renamed from table to container description="Delete a Cosmos DB container", # Updated description inputSchema={ "type": "object", "properties": { "container_name": { # Renamed from table_name "type": "string", "description": "Name of the Cosmos DB container", # Updated description }, "database_name": { "type": "string", "description": "Name of the Cosmos DB database (optional, defaults to 'defaultdb')", }, }, "required": ["container_name"], }, ),
- mcp_server_azure/azure_server.py:171-175 (registration)MCP server registration point that lists all available tools by calling get_azure_tools(), which includes the cosmosdb_container_delete tool.@server.list_tools() async def list_tools() -> list[Tool]: """List available Azure tools""" logger.debug("Handling list_tools request") return get_azure_tools() # Use get_azure_tools