get_cluster
Retrieve detailed information about a Databricks cluster using its cluster_id, enabling efficient management and monitoring within the Databricks MCP Server environment.
Instructions
Get information about a specific Databricks cluster with parameter: cluster_id (required)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- MCP tool handler for 'get_cluster'. Extracts cluster_id from input params and delegates to the clusters.get_cluster API function, returning JSON response or error.@self.tool( name="get_cluster", description="Get information about a specific Databricks cluster with parameter: cluster_id (required)", ) async def get_cluster(params: Dict[str, Any]) -> List[TextContent]: logger.info(f"Getting cluster info with params: {params}") try: result = await clusters.get_cluster(params.get("cluster_id")) return [{"text": json.dumps(result)}] except Exception as e: logger.error(f"Error getting cluster info: {str(e)}") return [{"text": json.dumps({"error": str(e)})}]
- src/api/clusters.py:62-76 (helper)Core API helper function that performs the actual Databricks API GET request to retrieve details for the specified cluster_id.async def get_cluster(cluster_id: str) -> Dict[str, Any]: """ Get information about a specific cluster. Args: cluster_id: ID of the cluster Returns: Response containing cluster information Raises: DatabricksAPIError: If the API request fails """ logger.info(f"Getting information for cluster: {cluster_id}") return make_api_request("GET", "/api/2.0/clusters/get", params={"cluster_id": cluster_id})