Skip to main content
Glama

deploy

Deploy Python scripts to Modal from Claude to create shareable web applications. Get a link to your deployed app for collaboration.

Instructions

some description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modal_pathNo

Implementation Reference

  • Core handler function for the 'deploy' tool that executes the Modal CLI deploy command via subprocess and returns the result.
    def deploy(modal_path: str = "model_app.py") -> str:
        """
        Deploy a model using Modal CLI command.
    
        Args:
            modal_path: Path to the modal file to deploy
    
        Returns:
            str: deployment result
        """
        try:
            # Run modal deploy command
            process = subprocess.run(["modal", "deploy", modal_path], capture_output=True, text=True)
            
            # Check if the command was successful
            if process.returncode == 0:
                return f"Deploy success: {process.stdout}"
            else:
                raise RuntimeError(f"Deploy failed: {process.stderr}")
            # if process.returncode == 0:
            #     message = f"Deployment successful: {stdout.decode()}"
            # else:
            #     message = f"Deployment failed: {stderr.decode()}"
            # return message
        except Exception as e:
            return f"Deployment error: {str(e)}"
  • Registration of the 'deploy' tool in the list_tools() method, including its name, description, and input schema.
        Tool(
            name="deploy",
            description="some description",
            inputSchema={
                "type": "object",
                "properties": {
                    "modal_path": {"type": "string"},
                },
                "required": ["message"],
            },
        )
    ]
  • Dispatch logic in the call_tool() handler specifically for the 'deploy' tool, which validates arguments, calls the deploy function, and formats the response.
    if name != "deploy":
        raise ValueError(f"Unknown tool: {name}")
    if not isinstance(arguments, dict) or "modal_path" not in arguments:
        raise ValueError("Invalid forecast arguments")
    modal_path = arguments["modal_path"]
    
    try:
        res = deploy(modal_path)
        return [
            TextContent(type="text", text=json.dumps(f"Deploy result: {res}", indent=2))
        ]
    except httpx.HTTPError as e:
  • JSON Schema defining the input for the 'deploy' tool (note: required field mismatch with properties).
    inputSchema={
        "type": "object",
        "properties": {
            "modal_path": {"type": "string"},
        },
        "required": ["message"],
    },

Tool Definition Quality

Score is being calculated. Check back soon.

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

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