Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

terminate_cluster

Shut down a Databricks cluster to stop resource usage and manage costs. Provide the cluster ID to terminate it.

Instructions

Terminate a Databricks cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYes

Implementation Reference

  • MCP tool handler for 'terminate_cluster'. Decorated with @mcp.tool() which registers it. Executes by calling clusters.terminate_cluster(), wraps in JSON, handles errors.
    @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 performs the actual Databricks API call to delete/terminate the 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})
  • The @mcp.tool() decorator registers this function as the 'terminate_cluster' MCP tool.
    @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)})
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'terminate' which implies a destructive mutation, but doesn't disclose critical behavioral traits: whether termination is irreversible, requires specific permissions, has side effects (e.g., data loss), or rate limits. This is inadequate for a mutation tool with zero annotation coverage.

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 waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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?

Given the tool's complexity (destructive mutation), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It fails to address key aspects like behavioral risks, parameter details, or expected outcomes, making it insufficient for safe and effective use.

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%, but the description adds no parameter semantics beyond what the schema's title ('Cluster Id') implies. It doesn't explain what 'cluster_id' represents, its format, or where to find it. With only one parameter, the baseline is 4, but the lack of any parameter details in the description reduces it to 3.

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 ('terminate') and target resource ('a Databricks cluster'), providing specific verb+resource. However, it doesn't differentiate from sibling tools like 'start_cluster' or 'get_cluster' beyond the obvious action difference, missing explicit sibling distinction.

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 on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., cluster must be running), exclusions (e.g., cannot terminate if jobs are active), or comparisons to siblings like 'start_cluster' or 'list_clusters'.

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

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