Skip to main content
Glama

delete_cluster

Remove a Dataproc cluster by specifying the Google Cloud project ID, region, and cluster name. This tool simplifies cluster management within the Dataproc MCP Server environment.

Instructions

Delete a Dataproc cluster.

Args: project_id: Google Cloud project ID region: Dataproc region cluster_name: Name of the cluster to delete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_nameYes
project_idYes
regionYes

Implementation Reference

  • MCP tool handler and registration for 'delete_cluster'. Resolves project and region using defaults if needed, instantiates DataprocClient, calls its delete_cluster method, handles exceptions, and returns result as string.
    @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 DataprocClient. Creates DeleteClusterRequest and executes the synchronous Google Cloud client.delete_cluster via thread pool executor, returns operation details.
    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

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

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