Skip to main content
Glama
JustTryAI

Databricks MCP Server

list_files

Browse and view files and directories stored in DBFS paths to manage Databricks data resources.

Instructions

List files and directories in a DBFS path with parameter: dbfs_path (required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • MCP tool handler for 'list_files' that extracts dbfs_path from params, calls the dbfs.list_files helper, and returns JSON-formatted result as TextContent.
    async def list_files(params: Dict[str, Any]) -> List[TextContent]:
        logger.info(f"Listing files with params: {params}")
        try:
            result = await dbfs.list_files(params.get("dbfs_path"))
            return [{"text": json.dumps(result)}]
        except Exception as e:
            logger.error(f"Error listing files: {str(e)}")
            return [{"text": json.dumps({"error": str(e)})}]
  • Registers the 'list_files' tool using the FastMCP @tool decorator with name and description specifying the required dbfs_path parameter.
    @self.tool(
        name="list_files",
        description="List files and directories in a DBFS path with parameter: dbfs_path (required)",
    )
  • Core helper function that performs the actual Databricks DBFS /list API request to retrieve files and directories at the given path.
    async def list_files(dbfs_path: str) -> Dict[str, Any]:
        """
        List files and directories in a DBFS path.
        
        Args:
            dbfs_path: The path to list
            
        Returns:
            Response containing the directory listing
            
        Raises:
            DatabricksAPIError: If the API request fails
        """
        logger.info(f"Listing files in DBFS path: {dbfs_path}")
        return make_api_request("GET", "/api/2.0/dbfs/list", params={"path": dbfs_path})
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. It states the action but doesn't disclose behavioral traits such as pagination, rate limits, authentication needs, error handling, or what happens with invalid paths. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 a single sentence that efficiently states the purpose and parameter. It's front-loaded with the core action and avoids unnecessary details. However, it could be slightly more structured by separating purpose from parameter explanation.

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 no annotations, 0% schema coverage, no output schema, and 1 parameter with nested objects, the description is incomplete. It lacks details on return values, error conditions, and behavioral context, making it inadequate for a tool with these complexities.

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%, with 1 parameter documented only as 'params' of type 'object' in the schema. The description adds that it's 'dbfs_path (required)', providing basic semantics, but doesn't explain format, constraints, or examples. This partially compensates but is insufficient given the low schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('files and directories'), specifying the scope as 'in a DBFS path'. It distinguishes from siblings like list_clusters or list_notebooks by focusing on DBFS files. However, it doesn't explicitly differentiate from potential similar file-listing tools that might exist elsewhere.

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?

No guidance is provided on when to use this tool versus alternatives. The description mentions the parameter but doesn't indicate prerequisites, typical use cases, or when other tools like list_notebooks might be more appropriate. It's purely functional without contextual advice.

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