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
| Name | Required | Description | Default |
|---|---|---|---|
| modal_path | No |
Implementation Reference
- src/modal_server/server.py:145-171 (handler)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)}"
- src/modal_server/server.py:111-122 (registration)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"], }, ) ]
- src/modal_server/server.py:130-141 (handler)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:
- src/modal_server/server.py:114-120 (schema)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"], },