Skip to main content
Glama
ChrisChoTW

databricks-mcp

by ChrisChoTW

get_cluster_events

Retrieve cluster event history including start, terminate, resize, and error events to monitor Databricks cluster activity and troubleshoot issues.

Instructions

Get cluster event history (start, terminate, resize, errors, etc.)

Args: cluster_id: Cluster ID limit: Max number of records to return

Returns: Event list (time in local timezone)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the get_cluster_events tool handler.
    def get_cluster_events(ctx: Context, cluster_id: str, limit: int = 20) -> List[Dict[str, Any]]:
        """
        Get cluster event history (start, terminate, resize, errors, etc.)
    
        Args:
            cluster_id: Cluster ID
            limit: Max number of records to return
    
        Returns:
            Event list (time in local timezone)
        """
        w = get_workspace_client()
        ctx.info(f"Querying cluster {cluster_id} events...")
    
        events_iter = w.clusters.events(cluster_id=cluster_id, limit=limit)
    
        results = []
        for event in events_iter:
            e = event.as_dict()
            ts = e.get("timestamp")
            if ts:
                local_time = datetime.utcfromtimestamp(ts / 1000) + timedelta(hours=8)
                time_str = local_time.strftime("%Y-%m-%d %H:%M:%S")
            else:
                time_str = None
    
            results.append({
                "time_local": time_str,
                "timestamp_ms": ts,
                "type": e.get("type"),
                "details": e.get("details")
            })
    
        return results
  • Registration of the get_cluster_events tool using the @mcp.tool decorator.
    @mcp.tool
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 mentions the tool returns event history with time in local timezone, which adds some context, but lacks details on permissions, rate limits, pagination, or error handling. For a read operation with no annotations, this is insufficient.

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 well-structured with a clear purpose statement followed by 'Args:' and 'Returns:' sections. It's front-loaded and efficient, though the 'Args:' section could be slightly more detailed given the low schema coverage.

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

Completeness3/5

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

Given 2 parameters with 0% schema coverage and no annotations, but with an output schema (implied by 'Returns: Event list'), the description is moderately complete. It covers parameters and return type, but lacks behavioral context like error cases or performance considerations, making it adequate but with clear gaps.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explicitly lists both parameters ('cluster_id' and 'limit') with brief explanations, adding meaning beyond the bare schema. However, it doesn't specify format for 'cluster_id' or constraints for 'limit' beyond 'Max number of records', leaving some gaps.

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 tool's purpose: 'Get cluster event history' with specific event types listed (start, terminate, resize, errors, etc.). It uses a specific verb ('Get') and resource ('cluster event history'), but doesn't explicitly differentiate from sibling tools like 'list_clusters' or 'get_cluster_metrics' beyond the event focus.

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 doesn't mention prerequisites, context for usage, or compare it to sibling tools like 'list_clusters' or 'get_cluster_metrics', leaving the agent to infer usage based on the 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/ChrisChoTW/databricks-mcp'

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