Skip to main content
Glama
ibenlems

Databricks Spark Analyzer MCP

by ibenlems

analyze_stage

Diagnose a Spark stage by examining shuffle, skew, spill, and GC metrics, slowest tasks, anti-patterns, and query-plan details to pinpoint performance bottlenecks.

Instructions

Deep-dive one Spark stage of a run: shuffle/skew/spill/GC numbers, slowest tasks, anti-patterns and a detailed analysis of the stage's query plan.

Input Schema

NameRequiredDescriptionDefault
job_idNo
run_idYes
stage_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose substantive content: the metric families analyzed, slowest-task inspection, anti-pattern detection, and query-plan analysis. However, it says nothing about execution cost/latency (a 'deep-dive' over a large stage is plausibly expensive), whether it works on incomplete or running runs, or required access scope.

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?

A single front-loaded sentence naming the verb, scope, and output content with no filler. Every clause earns its place.

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?

An output schema exists, so return shape needn't be described, and the description does characterize what the analysis surfaces. But for a 3-parameter tool with zero schema description coverage and no annotations, the unexplained job_id and missing access/cost guidance leave real gaps.

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%, so the description must compensate and largely fails. The phrase 'one Spark stage of a run' loosely implies run_id and stage_id, but the optional job_id is never mentioned and its disambiguation role is left entirely unexplained.

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?

States a specific verb and resource ('Deep-dive one Spark stage of a run') and enumerates what the analysis covers (shuffle/skew/spill/GC, slowest tasks, anti-patterns, query plan). The 'one Spark stage' scoping implicitly contrasts with analyze_run's whole-run scope, but no sibling is named explicitly.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this is the stage-level drill-down tool to reach for after a run-level analysis. There is no explicit when-to-use guidance, no mention of when to prefer diagnose_job or analyze_run, and no prerequisites or cost warnings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.