Skip to main content
Glama
JustTryAI

Databricks MCP Server

list_notebooks

Retrieve a list of notebooks from a specified workspace directory in Databricks. Use this tool to view available notebooks for development or analysis tasks.

Instructions

List notebooks in a workspace directory with parameter: path (required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • MCP tool handler for 'list_notebooks': decorator registers the tool and the function wraps the API call to list notebooks in a Databricks workspace directory, handling params and errors.
        name="list_notebooks",
        description="List notebooks in a workspace directory with parameter: path (required)",
    )
    async def list_notebooks(params: Dict[str, Any]) -> List[TextContent]:
        logger.info(f"Listing notebooks with params: {params}")
        try:
            result = await notebooks.list_notebooks(params.get("path"))
            return [{"text": json.dumps(result)}]
        except Exception as e:
            logger.error(f"Error listing notebooks: {str(e)}")
            return [{"text": json.dumps({"error": str(e)})}]
  • Helper function implementing the core logic: calls Databricks /api/2.0/workspace/list API to retrieve the list of notebooks/files in the specified 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})
  • Tool registration via @self.tool decorator specifying name and description (input schema inferred).
        name="list_notebooks",
        description="List notebooks in a workspace directory with parameter: path (required)",
    )
    async def list_notebooks(params: Dict[str, Any]) -> List[TextContent]:
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. While it mentions the tool lists notebooks, it doesn't disclose any behavioral traits - no information about pagination, sorting, filtering capabilities, authentication requirements, rate limits, or what happens when the path doesn't exist. For a listing tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise - a single sentence that states the purpose and mentions the required parameter. There's no wasted language, though it could benefit from being more informative while maintaining brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero annotation coverage, 0% schema description coverage, no output schema, and a parameter that's a nested object with no documentation, the description is insufficient. It doesn't explain what 'notebooks' are in this context, what format the output takes, or how to interpret the path parameter - leaving significant gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only mentions 'path (required)' without explaining what format the path should take, what workspace/directory structure it references, or any constraints. With 1 parameter that's completely undocumented in both schema and description, the description adds minimal value beyond stating the parameter exists.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'List notebooks in a workspace directory', which provides a clear verb ('List') and resource ('notebooks'). However, it doesn't distinguish this tool from potential siblings like 'list_files' or 'list_clusters' - it's unclear what makes notebooks different from other file types or resources in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_files' and 'list_clusters' available, there's no indication of whether this tool is for a specific notebook format, workspace context, or how it differs from general file listing operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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