blob_list
List all blobs in an Azure Blob Storage container to view stored files and manage storage content.
Instructions
List blobs in a Blob Storage container
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_name | Yes | Name of the Blob Storage container |
Implementation Reference
- mcp_server_azure/azure_server.py:212-218 (handler)The core handler logic for the 'blob_list' tool. It gets the container client for the given container_name, lists the blobs, extracts their names, and prepares the response dictionary.elif name == "blob_list": container_client = blob_service_client.get_container_client( arguments["container_name"] ) blob_list = container_client.list_blobs() blob_names = [blob.name for blob in blob_list] response = {"blob_names": blob_names}
- The Tool definition providing the schema (inputSchema) and metadata for the 'blob_list' tool, used for registration and validation.Tool( name="blob_list", description="List blobs in a Blob Storage container", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container", } }, "required": ["container_name"], }, ),
- mcp_server_azure/azure_server.py:172-176 (registration)Server registration of tools via the list_tools handler, which returns get_azure_tools() including the blob_list tool.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_tools.py:396-401 (registration)Aggregator function that includes get_blob_storage_tools() which defines the blob_list tool.def get_azure_tools() -> list[Tool]: return [ *get_blob_storage_tools(), *get_cosmosdb_tools(), *get_app_configuration_tools() ]
- mcp_server_azure/azure_tools.py:5-112 (registration)Function defining and returning the list of blob storage tools, including the blob_list Tool instance.def get_blob_storage_tools() -> list[Tool]: return [ 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"], }, ), Tool( name="blob_container_list", description="List all Blob Storage containers", inputSchema={"type": "object", "properties": {}}, ), Tool( name="blob_container_delete", description="Delete a Blob Storage container", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container to delete", } }, "required": ["container_name"], }, ), Tool( name="blob_upload", description="Upload a blob to Blob Storage", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container", }, "blob_name": { "type": "string", "description": "Name of the blob in the container", }, "file_content": { "type": "string", "description": "Base64 encoded file content for upload", }, }, "required": ["container_name", "blob_name", "file_content"], }, ), Tool( name="blob_delete", description="Delete a blob from Blob Storage", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container", }, "blob_name": { "type": "string", "description": "Name of the blob to delete", }, }, "required": ["container_name", "blob_name"], }, ), Tool( name="blob_list", description="List blobs in a Blob Storage container", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container", } }, "required": ["container_name"], }, ), Tool( name="blob_read", description="Read a blob's content from Blob Storage", inputSchema={ "type": "object", "properties": { "container_name": { "type": "string", "description": "Name of the Blob Storage container", }, "blob_name": { "type": "string", "description": "Name of the blob to read", }, }, "required": ["container_name", "blob_name"], }, ), ]