blob_container_create
Create a new Azure Blob Storage container using the specified name, enabling organized data storage and management through the Azure MCP Server.
Instructions
Create a new Blob Storage container
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_name | Yes | Name of the Blob Storage container to create |
Input Schema (JSON Schema)
{
"properties": {
"container_name": {
"description": "Name of the Blob Storage container to create",
"type": "string"
}
},
"required": [
"container_name"
],
"type": "object"
}
Implementation Reference
- mcp_server_azure/azure_server.py:184-191 (handler)The core handler logic for the 'blob_container_create' tool, which creates a new Blob Storage container using the BlobServiceClient and returns confirmation.if name == "blob_container_create": container_client = blob_service_client.create_container( arguments["container_name"] ) response = { "container_name": container_client.container_name, "created": True, } # Simplify response
- mcp_server_azure/azure_tools.py:7-20 (schema)Defines the input schema and metadata for the 'blob_container_create' tool, specifying the required 'container_name' parameter.Tool( name="blob_container_create", description="Create a new Blob Storage container", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container to create", } }, "required": ["container_name"], }, ),
- mcp_server_azure/azure_server.py:171-176 (registration)Registers the 'blob_container_create' tool (among others) by returning the list of Azure tools via the MCP server's list_tools handler.@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
- mcp_server_azure/azure_server.py:432-435 (handler)Dispatches calls to 'blob_container_create' (and other blob tools) to the specific blob storage operations handler in the main call_tool function.if name.startswith("blob_"): # Updated prefix to blob_ return await handle_blob_storage_operations( azure_rm, name, arguments ) # Use blob handler
- Helper method in AzureResourceManager that provides the BlobServiceClient instance used by the blob_container_create handler.def get_blob_service_client( self, account_url: str | None = None ) -> BlobServiceClient: """Get an Azure Blob Service client.""" try: logger.info(f"Creating BlobServiceClient for account: {account_url}") account_url = account_url or os.getenv("AZURE_STORAGE_ACCOUNT_URL") if not account_url: raise ValueError( "Azure Storage Account URL is not specified and not set in the environment." ) return BlobServiceClient( account_url=account_url, credential=self.credential ) except Exception as e: logger.error(f"Failed to create BlobServiceClient: {e}") raise RuntimeError(f"Failed to create BlobServiceClient: {e}")