Skip to main content
Glama

delete_object

Remove a specific object from a Cloud Storage bucket on GCP by specifying the project ID, bucket name, and file name. Streamlines storage management directly through natural language commands.

Instructions

    Delete an object from a Cloud Storage bucket.
    
    Args:
        project_id: The ID of the GCP project
        bucket_name: The name of the bucket to delete from
        blob_name: The name of the file to delete
    
    Returns:
        Result of the delete operation
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blob_nameYes
bucket_nameYes
project_idYes

Implementation Reference

  • The main handler function for the 'delete_object' tool. It is decorated with @mcp.tool() for registration and implements the logic to delete a blob from a GCP Cloud Storage bucket using the google.cloud.storage library. Includes input parameters, docstring schema, and error handling.
    @mcp.tool()
    def delete_object(project_id: str, bucket_name: str, blob_name: str) -> str:
        """
        Delete an object from a Cloud Storage bucket.
        
        Args:
            project_id: The ID of the GCP project
            bucket_name: The name of the bucket to delete from
            blob_name: The name of the file to delete
        
        Returns:
            Result of the delete operation
        """
        try:
            from google.cloud import storage
            
            # Initialize the Storage client
            client = storage.Client(project=project_id)
            
            # Get the bucket
            bucket = client.get_bucket(bucket_name)
            
            # Delete the blob
            blob = bucket.blob(blob_name)
            blob.delete()
            
            return f"Object gs://{bucket_name}/{blob_name} has been successfully deleted."
        except Exception as e:
            return f"Error deleting object: {str(e)}"
  • Invocation of the storage module's register_tools function within the main server.py, which registers the 'delete_object' tool (and other storage tools) with the MCP server instance.
    storage_tools.register_tools(mcp)
  • Import of the storage tools module in the main server.py, enabling the registration of the 'delete_object' tool.
    from .gcp_modules.storage import tools as storage_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 for behavioral disclosure. It states this is a delete operation (implying destructive), but doesn't mention whether deletion is permanent, reversible, requires specific IAM permissions, has rate limits, or what happens with non-existent objects. The return value description ('Result of the delete operation') is vague.

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

Conciseness4/5

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

The description is appropriately sized with clear sections (purpose, Args, Returns). The first sentence states the core purpose directly. The Args section could be more concise but isn't excessively verbose.

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 destructive operation with no annotations and no output schema, the description is inadequate. It doesn't explain what 'Result of the delete operation' means (success/failure indicators, error conditions), doesn't mention authentication requirements, and provides minimal behavioral context for a potentially irreversible action.

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?

Schema description coverage is 0%, so the description must compensate. It provides a basic Args section naming the three parameters and their purpose, which adds meaningful context beyond the bare schema. However, it doesn't explain format requirements (e.g., bucket naming conventions), validation rules, or provide examples.

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 ('Delete an object') and resource ('from a Cloud Storage bucket'), providing specific verb+resource pairing. It doesn't explicitly differentiate from sibling tools like 'delete_instance' or 'download_object', but the cloud storage context is reasonably distinct.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, permissions needed, or when this operation is appropriate versus other deletion tools in the sibling list.

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

Related 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/henihaddad/gcp-mcp'

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