Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

list_clusters

Retrieve a list of all Databricks clusters to monitor resources, manage configurations, and track cluster status.

Instructions

List all Databricks clusters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_clusters': decorated with @mcp.tool(), logs the action, calls clusters.list_clusters() helper, returns JSON result or error.
    @mcp.tool()
    async def list_clusters() -> str:
        """List all Databricks clusters"""
        logger.info("Listing clusters")
        try:
            result = await clusters.list_clusters()
            return json.dumps(result)
        except Exception as e:
            logger.error(f"Error listing clusters: {str(e)}")
            return json.dumps({"error": str(e)})
  • Core helper function that performs the Databricks API GET request to /api/2.0/clusters/list to fetch clusters.
    async def list_clusters() -> Dict[str, Any]:
        """
        List all Databricks clusters.
        
        Returns:
            Response containing a list of clusters
            
        Raises:
            DatabricksAPIError: If the API request fails
        """
        logger.info("Listing all clusters")
        return make_api_request("GET", "/api/2.0/clusters/list")
  • The @mcp.tool() decorator registers the list_clusters function as an MCP tool.
    @mcp.tool()

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/samhavens/databricks-mcp-server'

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