Skip to main content
Glama

list_modal_volume_contents

List files and directories in a Modal volume to view storage contents and structure.

Instructions

List files and directories in a Modal volume.

Args:
    volume_name: Name of the Modal volume to list contents from.
    path: Path within the volume to list contents from. Defaults to root ("/").

Returns:
    A dictionary containing the parsed JSON output of the volume contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
volume_nameYes
pathNo/

Implementation Reference

  • The handler function for the 'list_modal_volume_contents' tool. It is decorated with @mcp.tool() for registration and implements the logic to list contents of a Modal volume using the Modal CLI, handling JSON responses via helper functions.
    @mcp.tool()
    async def list_modal_volume_contents(volume_name: str, path: str = "/") -> dict[str, Any]:
        """
        List files and directories in a Modal volume.
    
        Args:
            volume_name: Name of the Modal volume to list contents from.
            path: Path within the volume to list contents from. Defaults to root ("/").
    
        Returns:
            A dictionary containing the parsed JSON output of the volume contents.
        """
        try:
            result = run_modal_command(["modal", "volume", "ls", "--json", volume_name, path])
            response = handle_json_response(result, "Failed to list volume contents")
            if response["success"]:
                return {"success": True, "contents": response["data"]}
            return response
        except Exception as e:
            logger.error(f"Failed to list Modal volume contents: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format ('A dictionary containing the parsed JSON output'), which adds some value, but fails to address critical aspects like read-only nature, error conditions, pagination, or rate limits. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is well-structured and concise, with a clear purpose statement followed by separate 'Args' and 'Returns' sections. Each sentence adds value without redundancy, making it easy to parse and understand quickly. The formatting enhances readability without unnecessary verbosity.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and parameters but lacks usage guidelines, behavioral details, and output specifics. While it meets a minimum viable standard, it doesn't fully equip an agent for optimal tool selection and invocation in context with siblings.

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

Parameters4/5

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

The description adds meaningful context for both parameters: 'volume_name' is explained as 'Name of the Modal volume to list contents from,' and 'path' as 'Path within the volume to list contents from. Defaults to root ("/").' This compensates for the 0% schema description coverage by clarifying the purpose and default value, though it doesn't detail constraints or examples.

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 tool's purpose: 'List files and directories in a Modal volume.' It specifies the verb ('List') and resource ('files and directories in a Modal volume'), making the action and target explicit. However, it does not differentiate this tool from its sibling 'list_modal_volumes', which might cause confusion without additional 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. It lacks context such as prerequisites, when to choose this over 'list_modal_volumes' (which lists volumes themselves), or how it relates to other siblings like 'get_modal_volume_file'. This absence of usage instructions leaves the agent without clear direction.

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/smehmood/modal-mcp-server'

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