Skip to main content
Glama
warrenzhu25

Dataproc MCP Server

by warrenzhu25

delete_cluster

Remove a Dataproc cluster to manage Google Cloud resources by specifying cluster name, project ID, and region parameters.

Instructions

Delete a Dataproc cluster.

Args:
    cluster_name: Name of the cluster to delete
    project_id: Google Cloud project ID (optional, uses gcloud config default)
    region: Dataproc region (optional, uses gcloud config default)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_nameYes
project_idNo
regionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'delete_cluster'. This is the main entrypoint for the tool, decorated with @mcp.tool() for registration. It handles input validation via type hints, resolves defaults, and delegates to the DataprocClient.
    @mcp.tool()
    async def delete_cluster(
        cluster_name: str, project_id: str | None = None, region: str | None = None
    ) -> str:
        """Delete a Dataproc cluster.
    
        Args:
            cluster_name: Name of the cluster to delete
            project_id: Google Cloud project ID (optional, uses gcloud config default)
            region: Dataproc region (optional, uses gcloud config default)
        """
        resolved = resolve_project_and_region(project_id, region)
        if isinstance(resolved, str):  # Error message
            return resolved
        project_id, region = resolved
    
        client = DataprocClient()
        try:
            result = await client.delete_cluster(project_id, region, cluster_name)
            return str(result)
        except Exception as e:
            logger.error("Failed to delete cluster", error=str(e))
            return f"Error: {str(e)}"
  • Core implementation of cluster deletion in the DataprocClient class. This method constructs the DeleteClusterRequest and calls the Google Cloud Dataproc ClusterControllerClient.delete_cluster API via a thread executor.
    async def delete_cluster(
        self, project_id: str, region: str, cluster_name: str
    ) -> dict[str, Any]:
        """Delete a Dataproc cluster."""
        try:
            loop = asyncio.get_event_loop()
            client = self._get_cluster_client(region)
    
            request = types.DeleteClusterRequest(
                project_id=project_id, region=region, cluster_name=cluster_name
            )
    
            operation = await loop.run_in_executor(None, client.delete_cluster, request)
    
            operation_name = getattr(operation, "name", str(operation))
            return {
                "operation_name": operation_name,
                "cluster_name": cluster_name,
                "status": "DELETING",
                "message": f"Cluster deletion initiated. Operation: {operation_name}",
            }
    
        except Exception as e:
            logger.error("Failed to delete cluster", error=str(e))
            raise
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. While 'Delete' implies a destructive operation, it doesn't specify whether this action is irreversible, requires specific permissions, has confirmation prompts, or what happens to associated resources. The description lacks critical behavioral context for a destructive operation.

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 efficiently structured with a clear purpose statement followed by parameter documentation. Every sentence serves a purpose, though the parameter explanations could be slightly more concise. The information is appropriately front-loaded with the core functionality stated first.

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

Completeness3/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, the description is moderately complete given the existence of an output schema. It covers the basic purpose and parameters adequately but lacks important behavioral context about the deletion's consequences, permissions, or error conditions that would be crucial for safe tool invocation.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates by providing meaningful parameter explanations. It clarifies that 'project_id' and 'region' are optional with default fallbacks to gcloud config, which adds valuable context beyond what the schema's null/default values indicate. However, it doesn't explain format requirements or constraints for 'cluster_name'.

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

Purpose5/5

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

The description clearly states the specific action ('Delete') and resource ('a Dataproc cluster'), distinguishing it from sibling tools like 'create_cluster' or 'get_cluster'. It provides a complete verb+resource combination that leaves no ambiguity about the tool's function.

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 'cancel_job' or 'delete_batch_job', nor does it mention prerequisites or conditions for deletion. It simply states what the tool does without contextual usage information.

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/warrenzhu25/dataproc-mcp'

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