Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

list_notebooks

Retrieve a list of notebooks from a specified workspace directory in Databricks to manage and organize your data projects.

Instructions

List notebooks in a workspace directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP tool handler for the 'list_notebooks' tool. Takes a path parameter, lists notebooks using the notebooks API module, and returns the result as JSON or error message.
    @mcp.tool() async def list_notebooks(path: str) -> str: """List notebooks in a workspace directory""" logger.info(f"Listing notebooks in: {path}") try: result = await notebooks.list_notebooks(path) return json.dumps(result) except Exception as e: logger.error(f"Error listing notebooks: {str(e)}") return json.dumps({"error": str(e)})
  • Helper function that implements the core logic by calling the Databricks Workspace API endpoint /api/2.0/workspace/list to list notebooks or files at the given path.
    async def list_notebooks(path: str) -> Dict[str, Any]: """ List notebooks in a workspace directory. Args: path: The path to list Returns: Response containing the directory listing Raises: DatabricksAPIError: If the API request fails """ logger.info(f"Listing notebooks in path: {path}") return make_api_request("GET", "/api/2.0/workspace/list", params={"path": path})

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