get_cluster
Retrieve detailed information about a specific Databricks cluster by providing its cluster ID to access configuration, status, and resource details.
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
- src/server/databricks_mcp_server.py:89-92 (registration)Registration of the 'get_cluster' MCP tool with description specifying the required cluster_id parameter.@self.tool( name="get_cluster", description="Get information about a specific Databricks cluster with parameter: cluster_id (required)", )
- Handler function for the 'get_cluster' tool that extracts cluster_id from params, calls the clusters.get_cluster API, and returns JSON response or error.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 makes the Databricks GET request to /api/2.0/clusters/get with 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})