Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

create_cluster

Provision a new Databricks cluster with specified Spark version, node type, and worker count for data processing and analytics workloads.

Instructions

Create a new Databricks cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_nameYes
spark_versionYes
node_type_idYes
num_workersNo

Implementation Reference

  • MCP tool handler function for 'create_cluster', registered with @mcp.tool() decorator. Constructs cluster configuration from parameters and delegates to the core API function.
    @mcp.tool()
    async def create_cluster(
        cluster_name: str,
        spark_version: str,
        node_type_id: str,
        num_workers: int = 1
    ) -> str:
        """Create a new Databricks cluster"""
        logger.info(f"Creating cluster: {cluster_name}")
        try:
            cluster_config = {
                "cluster_name": cluster_name,
                "spark_version": spark_version,
                "node_type_id": node_type_id,
                "num_workers": num_workers,
                "enable_elastic_disk": True
            }
            result = await clusters.create_cluster(cluster_config)
            return json.dumps(result)
        except Exception as e:
            logger.error(f"Error creating cluster: {str(e)}")
            return json.dumps({"error": str(e)})
  • Core helper function that performs the actual Databricks API call to create a cluster using make_api_request.
    async def create_cluster(cluster_config: Dict[str, Any]) -> Dict[str, Any]:
        """
        Create a new Databricks cluster.
        
        Args:
            cluster_config: Cluster configuration
            
        Returns:
            Response containing the cluster ID
            
        Raises:
            DatabricksAPIError: If the API request fails
        """
        logger.info("Creating new cluster")
        return make_api_request("POST", "/api/2.0/clusters/create", data=cluster_config)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a cluster but doesn't describe what happens after creation (e.g., whether it starts automatically, returns a cluster ID, or has side effects like billing implications). It lacks details on permissions required, rate limits, or error conditions, 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to scan. Every word earns its place by directly stating the tool's purpose without redundancy or fluff.

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 mutation tool with 4 parameters, 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how to use the parameters, or behavioral aspects like idempotency or error handling. The agent lacks sufficient context to use this tool effectively beyond basic 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?

The schema description coverage is 0%, so the description must compensate by explaining parameters, but it provides no parameter information. The description doesn't mention any of the four parameters (cluster_name, spark_version, node_type_id, num_workers) or their purposes, leaving them entirely undocumented. This fails to add value beyond the bare schema.

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 ('Create') and resource ('new Databricks cluster'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'get_cluster', 'list_clusters', 'start_cluster', and 'terminate_cluster' by specifying creation rather than retrieval or management. However, it doesn't explicitly differentiate from other creation tools like 'create_job' or 'create_notebook' beyond the resource type.

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. It doesn't mention prerequisites (e.g., needing proper permissions or available resources), when not to use it (e.g., if a cluster already exists), or how it relates to sibling tools like 'start_cluster' or 'terminate_cluster'. The agent must infer usage from the tool name alone.

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