Skip to main content
Glama

blob_upload

Upload files to Azure Blob Storage by specifying container, blob name, and base64-encoded content for cloud storage management.

Instructions

Upload a blob to Blob Storage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_nameYesName of the Blob Storage container
blob_nameYesName of the blob in the container
file_contentYesBase64 encoded file content for upload

Implementation Reference

  • Executes the blob_upload tool by getting a blob client from BlobServiceClient, base64-decoding the file content, and uploading it to the specified container and blob name with overwrite.
    elif name == "blob_upload":
        blob_client = blob_service_client.get_blob_client(
            container=arguments["container_name"], blob=arguments["blob_name"]
        )
        decoded_content = base64.b64decode(arguments["file_content"])
        blob_client.upload_blob(decoded_content, overwrite=True)
        response = {"blob_name": arguments["blob_name"], "uploaded": True}
  • Defines the input schema and Tool metadata for 'blob_upload', specifying required parameters: container_name, blob_name, and base64-encoded file_content.
    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"],
        },
    ),
  • Registers the blob_upload tool (among others) by returning the list from get_azure_tools() in response to list_tools requests.
    async def list_tools() -> list[Tool]:
        """List available Azure tools"""
        logger.debug("Handling list_tools request")
        return get_azure_tools()  # Use get_azure_tools
  • The dispatcher function for all blob_* tools, including blob_upload, which is invoked from the main call_tool handler.
    async def handle_blob_storage_operations(
        azure_rm: AzureResourceManager, name: str, arguments: dict
    ) -> list[TextContent]:
        """Handle Azure Blob Storage operations"""
        blob_service_client = azure_rm.get_blob_service_client()
        response = None
    
        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
        elif name == "blob_container_list":
            containers = blob_service_client.list_containers()
            container_names = [container.name for container in containers]
            response = {"container_names": container_names}
        elif name == "blob_container_delete":
            blob_service_client.delete_container(arguments["container_name"])
            response = {"container_name": arguments["container_name"], "deleted": True}
        elif name == "blob_upload":
            blob_client = blob_service_client.get_blob_client(
                container=arguments["container_name"], blob=arguments["blob_name"]
            )
            decoded_content = base64.b64decode(arguments["file_content"])
            blob_client.upload_blob(decoded_content, overwrite=True)
            response = {"blob_name": arguments["blob_name"], "uploaded": True}
        elif name == "blob_delete":
            blob_client = blob_service_client.get_blob_client(
                container=arguments["container_name"], blob=arguments["blob_name"]
            )
            blob_client.delete_blob()
            response = {"blob_name": arguments["blob_name"], "deleted": True}
        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}
        elif name == "blob_read":
            blob_client = blob_service_client.get_blob_client(
                container=arguments["container_name"], blob=arguments["blob_name"]
            )
            downloader = blob_client.download_blob()
            content = downloader.readall().decode("utf-8")
            return [TextContent(type="text", text=content)]
        else:
            raise ValueError(f"Unknown Blob Storage operation: {name}")
    
        azure_rm.log_operation(
            "blob_storage", name.replace("blob_", ""), arguments
        )  # Update service name in log
        return [
            TextContent(
                type="text",
                text=f"Operation Result:\n{json.dumps(response, indent=2, default=custom_json_serializer)}",
            )
        ]
  • Combines and returns all Azure tools lists, including blob_upload from get_blob_storage_tools().
    def get_azure_tools() -> list[Tool]:
        return [
            *get_blob_storage_tools(), 
            *get_cosmosdb_tools(),
            *get_app_configuration_tools()
        ]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't mention whether this is a write operation (implied but not explicit), what permissions are required, potential rate limits, error conditions, or what happens if a blob already exists (overwrite vs. error). This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and easy to parse. Every word earns its place by conveying essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., success confirmation, blob URL, error details), behavioral traits like idempotency or side effects, or how it fits into the broader blob storage workflow with siblings. This leaves the agent under-informed for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all three parameters (container_name, blob_name, file_content). The description adds no additional parameter semantics beyond what's in the schema, such as format constraints or examples. This meets the baseline of 3 since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Upload') and target resource ('a blob to Blob Storage'), making the purpose immediately understandable. However, it doesn't differentiate itself from sibling tools like blob_container_create or blob_delete, which would require mentioning it specifically handles file content uploads rather than container or metadata operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like blob_container_create for creating containers first, or blob_read for retrieving blobs. It lacks any context about prerequisites (e.g., needing an existing container) or typical use cases, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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