Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

terminate_cluster

Terminate a Databricks cluster by specifying its cluster_id to shut down resources, ensuring efficient cluster management and cost control.

Instructions

Terminate a Databricks cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYes

Implementation Reference

  • MCP tool handler for 'terminate_cluster' decorated with @mcp.tool(). Delegates to the clusters API module to perform the termination and returns JSON response.
    @mcp.tool() async def terminate_cluster(cluster_id: str) -> str: """Terminate a Databricks cluster""" logger.info(f"Terminating cluster: {cluster_id}") try: result = await clusters.terminate_cluster(cluster_id) return json.dumps(result) except Exception as e: logger.error(f"Error terminating cluster: {str(e)}") return json.dumps({"error": str(e)})
  • Core helper function that makes the actual Databricks API request (POST /api/2.0/clusters/delete) to terminate the specified cluster.
    async def terminate_cluster(cluster_id: str) -> Dict[str, Any]: """ Terminate a Databricks cluster. Args: cluster_id: ID of the cluster to terminate Returns: Empty response on success Raises: DatabricksAPIError: If the API request fails """ logger.info(f"Terminating cluster: {cluster_id}") return make_api_request("POST", "/api/2.0/clusters/delete", data={"cluster_id": cluster_id})

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/samhavens/databricks-mcp-server'

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