Skip to main content
Glama

list_clusters

Retrieve a comprehensive list of all Databricks clusters to manage and monitor resources effectively using the Databricks MCP Server.

Instructions

List all Databricks clusters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • MCP tool handler for 'list_clusters': registers the tool and implements the logic by calling the clusters.list_clusters API function, formatting the response as TextContent.
    @self.tool( name="list_clusters", description="List all Databricks clusters", ) async def list_clusters(params: Dict[str, Any]) -> List[TextContent]: logger.info(f"Listing clusters with params: {params}") try: result = await clusters.list_clusters() return [{"text": json.dumps(result)}] except Exception as e: logger.error(f"Error listing clusters: {str(e)}") return [{"text": json.dumps({"error": str(e)})}]
  • Core API helper function list_clusters() that makes a GET request to Databricks /api/2.0/clusters/list endpoint.
    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")
  • Registration of the 'list_clusters' tool using FastMCP @self.tool decorator.
    @self.tool( name="list_clusters", description="List all Databricks clusters", )

Other Tools

Related Tools

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

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