Skip to main content
Glama

deploy_modal_app

Deploy Modal applications to a serverless cloud environment by specifying the absolute path to your app files.

Instructions

Deploy a Modal application using the provided parameters.

Args:
    absolute_path_to_app: The absolute path to the Modal application to deploy.

Returns:
    A dictionary containing deployment results.

Raises:
    Exception: If deployment fails for any reason.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
absolute_path_to_appYes

Implementation Reference

  • The main asynchronous handler function for the deploy_modal_app tool. It is registered via the @mcp.tool() decorator and implements the deployment logic by calling run_modal_command to execute 'modal deploy' on the specified app path.
    @mcp.tool()
    async def deploy_modal_app(absolute_path_to_app: str) -> dict[str, Any]:
        """
        Deploy a Modal application using the provided parameters.
    
        Args:
            absolute_path_to_app: The absolute path to the Modal application to deploy.
    
        Returns:
            A dictionary containing deployment results.
    
        Raises:
            Exception: If deployment fails for any reason.
        """
        uv_directory = os.path.dirname(absolute_path_to_app)
        app_name = os.path.basename(absolute_path_to_app)
        try:
            result = run_modal_command(["modal", "deploy", app_name], uv_directory)
            return result
        except Exception as e:
            logger.error(f"Failed to deploy Modal app: {e}")
            raise
  • Supporting utility function used by deploy_modal_app to run Modal CLI commands via subprocess, handling uv run if directory provided, and returning structured success/error results.
    def run_modal_command(command: list[str], uv_directory: str = None) -> dict[str, Any]:
        """Run a Modal CLI command and return the result"""
        try:
            # uv_directory is necessary for modal deploy, since deploying the app requires the app to use the uv venv
            command = (["uv", "run", f"--directory={uv_directory}"] if uv_directory else []) + command
            logger.info(f"Running command: {' '.join(command)}")
            result = subprocess.run(
                command,
                capture_output=True,
                text=True,
                check=True
            )
            return {
                "success": True,
                "stdout": result.stdout,
                "stderr": result.stderr,
                "command": ' '.join(command)
            }
        except subprocess.CalledProcessError as e:
            return {
                "success": False,
                "error": str(e),
                "stdout": e.stdout,
                "stderr": e.stderr,
                "command": ' '.join(command)
            }
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 that deployment can fail and raises exceptions, but doesn't describe what 'deploy' actually does (e.g., creates resources, starts services), what permissions are required, whether it's idempotent, or any rate limits. For a deployment tool with zero annotation coverage, this is insufficient.

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 sized with clear sections (Args, Returns, Raises). It's front-loaded with the core purpose statement. However, the 'Raises' section could be more specific than just 'Exception'.

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?

For a deployment tool with no annotations, no output schema, and minimal parameter documentation, the description is incomplete. It doesn't explain what deployment entails, what the return dictionary contains, or provide sufficient context for safe and effective use. The sibling tools suggest this operates in a Modal environment, but that context isn't leveraged.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It adds that the parameter is 'The absolute path to the Modal application to deploy' which provides basic semantics, but doesn't explain what constitutes a 'Modal application' (e.g., a directory, a specific file format), path format requirements, or validation rules. This provides minimal compensation for the schema gap.

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 'Deploy a Modal application' which provides a clear verb+resource combination. However, it doesn't differentiate from sibling tools (which all deal with Modal volumes/files, not deployments), making the purpose clear but lacking sibling differentiation.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, when deployment is appropriate, or what alternatives might exist for similar 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/smehmood/modal-mcp-server'

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