Skip to main content
Glama
JustTryAI

Databricks MCP Server

terminate_cluster

Stop and decommission a Databricks cluster using its cluster ID to manage resources and control costs.

Instructions

Terminate a Databricks cluster with parameter: cluster_id (required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Core handler implementing the cluster termination logic by calling the Databricks Clusters API delete endpoint.
    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})
  • MCP tool registration and wrapper handler that registers the 'terminate_cluster' tool and delegates to the core API handler.
    @self.tool(
        name="terminate_cluster",
        description="Terminate a Databricks cluster with parameter: cluster_id (required)",
    )
    async def terminate_cluster(params: Dict[str, Any]) -> List[TextContent]:
        logger.info(f"Terminating cluster with params: {params}")
        try:
            result = await clusters.terminate_cluster(params.get("cluster_id"))
            return [{"text": json.dumps(result)}]
        except Exception as e:
            logger.error(f"Error terminating cluster: {str(e)}")
            return [{"text": json.dumps({"error": str(e)})}]
  • FastAPI endpoint handler for cluster termination (compatibility stub).
    async def terminate_cluster(request_data: dict):
        """Terminate a cluster."""
        result = await clusters.terminate_cluster(request_data.get("cluster_id"))
        return result
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose if termination is destructive, irreversible, requires specific permissions, has side effects, or what happens post-termination, leaving significant gaps for a mutation tool.

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 a single, efficient sentence with no wasted words, making it easy to parse. However, it's slightly under-specified given the tool's complexity, as it could benefit from more detail without sacrificing brevity.

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 mutation tool with no annotations, 0% schema coverage, and no output schema, the description is inadequate. It lacks critical context like behavioral traits, parameter details, and usage scenarios, making it incomplete for safe and effective tool invocation.

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

Parameters2/5

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

Schema description coverage is 0%, and the description only mentions 'cluster_id (required)' without explaining what it is, its format, or where to find it. This adds minimal value beyond the schema's required 'params' object, failing to compensate for the coverage gap.

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 resource ('a Databricks cluster'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_cluster' or 'start_cluster' beyond the obvious action difference, missing explicit comparison.

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. It mentions a required parameter but doesn't specify prerequisites, conditions for termination, or when to choose this over other cluster-related tools like 'start_cluster' or 'get_cluster'.

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

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