get_cluster
Retrieve detailed information about a Databricks cluster by providing its cluster ID, enabling efficient management and monitoring through the Databricks MCP Server.
Instructions
Get information about a specific Databricks cluster
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_id | Yes |
Implementation Reference
- MCP tool handler for 'get_cluster'. Decorated with @mcp.tool() to register it. Calls clusters.get_cluster() API wrapper and returns JSON response.@mcp.tool() async def get_cluster(cluster_id: str) -> str: """Get information about a specific Databricks cluster""" logger.info(f"Getting cluster info: {cluster_id}") try: result = await clusters.get_cluster(cluster_id) return json.dumps(result) except Exception as e: logger.error(f"Error getting cluster info: {str(e)}") return json.dumps({"error": str(e)})
- src/api/clusters.py:62-76 (helper)API wrapper function get_cluster that performs the actual Databricks API call to retrieve cluster information by 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})
- src/server/simple_databricks_mcp_server.py:74-74 (registration)The @mcp.tool() decorator registers the get_cluster function as an MCP tool.@mcp.tool()