Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

run_job

Execute Databricks jobs by specifying a job ID and optional notebook parameters to trigger data processing, analytics, or automation workflows.

Instructions

Run a Databricks job

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes
notebook_paramsNo

Implementation Reference

  • MCP tool handler for run_job: registers the tool, handles input parameters, calls the jobs API wrapper, serializes response to JSON, and manages errors.
    @mcp.tool()
    async def run_job(job_id: str, notebook_params: Optional[Dict[str, Any]] = None) -> str:
        """Run a Databricks job"""
        logger.info(f"Running job: {job_id}")
        try:
            if notebook_params is None:
                notebook_params = {}
            result = await jobs.run_job(job_id, notebook_params)
            return json.dumps(result)
        except Exception as e:
            logger.error(f"Error running job: {str(e)}")
            return json.dumps({"error": str(e)})
  • Core API wrapper that constructs the request parameters and calls Databricks /api/2.0/jobs/run-now endpoint to trigger the job execution.
    async def run_job(job_id: int, notebook_params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
        """
        Run a job now.
        
        Args:
            job_id: ID of the job to run
            notebook_params: Optional parameters for the notebook
            
        Returns:
            Response containing the run ID
            
        Raises:
            DatabricksAPIError: If the API request fails
        """
        logger.info(f"Running job: {job_id}")
        
        run_params = {"job_id": job_id}
        if notebook_params:
            run_params["notebook_params"] = notebook_params
            
        return make_api_request("POST", "/api/2.0/jobs/run-now", data=run_params)
  • FastMCP @mcp.tool() decorator registers the run_job function as an MCP tool with auto-generated schema from signature and docstring.
    @mcp.tool()
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Run a Databricks job' but fails to disclose critical traits: whether this is a read or write operation (likely a write that triggers execution), what permissions or authentication are needed, potential side effects (e.g., resource consumption, job execution), rate limits, or what happens on success/failure. For a tool that likely performs a significant action, this lack of detail is inadequate.

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 zero waste—it's appropriately sized and front-loaded. However, it's overly concise to the point of under-specification, lacking necessary details. While it earns points for brevity, it sacrifices clarity, so it's not a perfect 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a likely write operation to run jobs), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain what the tool does beyond the name, provide usage context, detail parameters, or describe expected outcomes. For a tool in a Databricks environment with many siblings, this is severely inadequate.

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%, meaning parameters are undocumented in the schema. The description adds no meaning beyond the schema—it doesn't explain what 'job_id' refers to (e.g., an existing job identifier) or what 'notebook_params' are (e.g., key-value pairs for notebook execution). With 2 parameters and no schema descriptions, the description fails to compensate, leaving semantics unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Run a Databricks job' is a tautology that essentially restates the tool name. It specifies the verb ('Run') and resource ('Databricks job'), but doesn't distinguish this from sibling tools like 'create_job' or 'list_job_runs'—it doesn't clarify what 'running' entails versus creating or listing. While it identifies the basic action, it lacks specificity about what the tool actually does beyond the obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 an existing job), exclusions (e.g., not for creating jobs), or context for choosing it over siblings like 'execute_sql' or 'list_job_runs'. There's no indication of appropriate scenarios, making it misleading if an agent assumes it can create or manage jobs.

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