Skip to main content
Glama

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

NameRequiredDescriptionDefault
container_nameYesName 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

  • 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
  • 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"], }, ),
  • 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
  • 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}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mashriram/azure_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server