| deploy_modal_appA | Deploy a Modal application (`modal deploy`). Deployed web endpoints persist after
this call returns, so any URLs in the output are live, shareable links.
Args:
absolute_path_to_app: Absolute path to the Modal app file to deploy. Its
directory must use `uv` and have `modal` installed in its virtualenv.
env: Optional Modal environment to deploy into.
name: Optional deployment name (`--name`).
tag: Optional version tag for the deployment (`--tag`).
strategy: Optional rollout strategy: "rolling" or "recreate" (`--strategy`).
stream_logs: If True, stream logs from the app after deploy (`--stream-logs`).
Returns:
A dictionary with deployment results. `urls` lists any web-endpoint/dashboard
links found in the output.
|
| run_modal_appA | Run a Modal function or local entrypoint (`modal run`). Unlike deploy, this executes
the app once and streams its logs; use it to test a function on Modal compute.
Args:
absolute_path_to_app: Absolute path to the Modal app file. Its directory must
use `uv` and have `modal` installed in its virtualenv.
function_name: Optional function / entrypoint name, e.g. "main". When omitted,
Modal runs the single entrypoint/function if the module has exactly one.
env: Optional Modal environment to target.
detach: If True, keep the app running on Modal even if this process disconnects
(`--detach`). Useful for long jobs you don't want cut off at the timeout.
timeout_seconds: Max seconds to collect output before returning. Defaults to 120.
Returns:
A dictionary with collected output. `truncated` is True when the run was still
going at the timeout. `urls` lists any links found in the output.
|
| list_modal_appsA | List Modal apps that are currently deployed/running or recently stopped.
Useful for discovering the app name or ID to pass to other app tools.
Args:
env: Optional Modal environment to target. If omitted, uses the profile's
default environment (or the MODAL_ENVIRONMENT variable).
Returns:
A dictionary containing the parsed JSON list of apps.
|
| get_modal_app_logsA | Fetch logs for a Modal app by name or app ID (`modal app logs`).
By default the CLI fetches recent entries and exits. Pass `follow=True` to live-stream
(collected for up to `timeout_seconds`, then cut off as a snapshot). Use list_modal_apps
to discover the app name/ID.
Args:
app_identifier: App name (e.g. "my-app") or app ID (e.g. "ap-123456").
timeout_seconds: Max seconds to collect logs before returning. Defaults to 30.
env: Optional Modal environment to target.
since: Start of time range — ISO 8601 datetime or relative time like "2h", "30m", "1d".
until: End of time range (same formats as `since`).
tail: Show only the last N log entries.
search: Only include log lines matching this search text.
source: Filter by source: "stdout", "stderr", or "system".
follow: If True, live-stream logs until the app stops or the timeout is reached.
Returns:
A dictionary with the collected logs. `truncated` is True when the stream was still
active at the timeout (i.e. logs are a partial snapshot).
|
| stop_modal_appA | Permanently stop a Modal app and terminate its running containers (`modal app stop`).
Args:
app_identifier: App name (e.g. "my-app") or app ID (e.g. "ap-123456").
env: Optional Modal environment to target.
Returns:
A dictionary containing the result of the stop operation.
|
| rollback_modal_appA | Roll a Modal app back to a previous deployment version (`modal app rollback`).
Args:
app_identifier: App name or app ID.
version: Optional specific version to roll back to. If omitted, Modal rolls back
to the immediately preceding version. Use get_modal_app_history to list versions.
env: Optional Modal environment to target.
Returns:
A dictionary containing the result of the rollback operation.
|
| get_modal_app_historyA | Show a Modal app's deployment history (`modal app history`).
Useful for finding a version to pass to rollback_modal_app.
Args:
app_identifier: App name or app ID.
env: Optional Modal environment to target.
Returns:
A dictionary containing the parsed JSON deployment history.
|
| list_modal_containersA | List all Modal containers that are currently running (`modal container list`).
Args:
app_id: Optional app ID to only list containers for that app.
env: Optional Modal environment to target.
Returns:
A dictionary containing the parsed JSON list of containers (IDs like "ta-...").
|
| get_modal_container_logsA | Fetch or stream logs for a specific Modal container (`modal container logs`).
Args:
container_id: Container ID (e.g. "ta-123456"), from list_modal_containers.
timeout_seconds: Max seconds to collect logs before returning. Defaults to 30.
since: Start of time range — ISO 8601 or relative like "2h", "30m", "1d".
until: End of time range (same formats as `since`).
tail: Show only the last N log entries.
search: Only include log lines matching this search text.
source: Filter by source: "stdout", "stderr", or "system".
follow: If True, live-stream logs until the container stops or the timeout hits.
Returns:
A dictionary with the collected logs. `truncated` is True when the stream was cut
off at the timeout.
|
| exec_modal_containerA | Execute a command inside a running Modal container (`modal container exec`).
Args:
container_id: Container ID (e.g. "ta-123456"), from list_modal_containers.
command: The command to run as a list of arguments,
e.g. ["python", "-c", "print('hi')"] or ["ls", "-la", "/"].
timeout_seconds: Max seconds to wait for the command before returning. Defaults to 60.
Returns:
A dictionary with the command's captured output. `truncated` is True if the
command was still running at the timeout.
|
| stop_modal_containerA | Terminate a running Modal container (`modal container stop`).
Sends SIGINT to the container; in-flight inputs are cancelled and rescheduled elsewhere.
Args:
container_id: Container ID (e.g. "ta-123456"), from list_modal_containers.
Returns:
A dictionary containing the result of the stop operation.
|
| search_modal_logsA | Search an app's or container's logs for a pattern and return matches WITH surrounding
context — useful for finding where something went wrong (errors, tracebacks, a request
ID, etc.). Logs are fetched once and grepped locally, so unlike the `search` argument
on the log tools you get the lines around each hit, not just the matching line.
Args:
identifier: App name/ID (e.g. "my-app", "ap-123456") or container ID ("ta-123456").
pattern: Text (or regex, if `regex=True`) to search for, e.g. "Traceback", "Error",
"timeout", or a request/job ID.
target: What `identifier` refers to: "app" (default) or "container".
regex: If True, treat `pattern` as a Python regular expression instead of literal text.
case_sensitive: If True, match case-sensitively. Defaults to case-insensitive.
context_lines: Number of lines to include before and after each match. Defaults to 3.
max_matches: Cap on the number of match blocks returned. Defaults to 50.
since: Only search logs newer than this — ISO 8601 or relative like "2h", "1d".
tail: Only search the last N log entries. If neither `since` nor `tail` is given,
the last 1000 entries are searched.
timeout_seconds: Max seconds to spend fetching logs before searching. Defaults to 30.
env: Optional Modal environment (apps only).
Returns:
A dictionary with `match_count` (total hits), `matches` (a list of context blocks,
each a string with line numbers; matched lines are prefixed with ">"), and
`returned` (how many blocks are included after `max_matches`).
|
| list_modal_volumesA | List all Modal volumes using the Modal CLI with JSON output.
Returns:
A dictionary containing the parsed JSON output of the Modal volumes list.
|
| list_modal_volume_contentsA | 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.
|
| copy_modal_volume_filesA | Copy files within a Modal volume. Can copy a source file to a destination file
or multiple source files to a destination directory.
Args:
volume_name: Name of the Modal volume to perform copy operation in.
paths: List of paths for the copy operation. The last path is the destination,
all others are sources. For example: ["source1.txt", "source2.txt", "dest_dir/"]
Returns:
A dictionary containing the result of the copy operation.
|
| remove_modal_volume_fileA | Delete a file or directory from a Modal volume.
Args:
volume_name: Name of the Modal volume to delete from.
remote_path: Path to the file or directory to delete.
recursive: If True, delete directories recursively. Required for deleting directories.
Returns:
A dictionary containing the result of the delete operation.
|
| put_modal_volume_fileA | Upload a file or directory to a Modal volume.
Args:
volume_name: Name of the Modal volume to upload to.
local_path: Path to the local file or directory to upload.
remote_path: Path in the volume to upload to. Defaults to root ("/").
If ending with "/", it's treated as a directory and the file keeps its name.
force: If True, overwrite existing files. Defaults to False.
Returns:
A dictionary containing the result of the upload operation.
|
| get_modal_volume_fileA | Download files from a Modal volume.
Args:
volume_name: Name of the Modal volume to download from.
remote_path: Path to the file or directory in the volume to download.
local_destination: Local path to save the downloaded file(s). Defaults to current directory.
Use "-" to write file contents to stdout.
force: If True, overwrite existing files. Defaults to False.
Returns:
A dictionary containing the result of the download operation.
|
| create_modal_volumeB | Create a named, persistent Modal volume (`modal volume create`).
Args:
volume_name: Name for the new volume.
env: Optional Modal environment to create the volume in.
Returns:
A dictionary containing the result of the create operation.
|
| delete_modal_volumeA | Delete a named Modal volume and ALL of its data (`modal volume delete`).
This is irreversible — the entire volume and its contents are removed. To delete
individual files instead, use remove_modal_volume_file.
Args:
volume_name: Name of the volume to delete.
env: Optional Modal environment to target.
Returns:
A dictionary containing the result of the delete operation.
|
| rename_modal_volumeB | Rename a Modal volume (`modal volume rename`).
Args:
old_name: Current volume name.
new_name: New volume name.
env: Optional Modal environment to target.
Returns:
A dictionary containing the result of the rename operation.
|
| list_modal_secretsA | List your published Modal secrets (`modal secret list`). Only names and timestamps
are returned — secret values are never exposed by the CLI.
Args:
env: Optional Modal environment to target.
Returns:
A dictionary containing the parsed JSON list of secrets.
|
| create_modal_secretA | Create a Modal secret (`modal secret create`). Provide the key/value pairs inline,
or load them from a local .env or JSON file. Secret values are redacted from the
returned `command` field.
Args:
secret_name: Name for the secret.
key_values: Mapping of secret keys to values, e.g. {"API_KEY": "abc", "DB_URL": "..."}.
from_dotenv: Path to a local .env file to load key/values from (`--from-dotenv`).
from_json: Path to a local JSON file to load key/values from (`--from-json`).
force: If True, overwrite the secret if it already exists (`--force`).
env: Optional Modal environment to create the secret in.
Returns:
A dictionary containing the result of the create operation, with values redacted.
|
| delete_modal_secretB | Delete a named Modal secret (`modal secret delete`).
Args:
secret_name: Name of the secret to delete.
env: Optional Modal environment to target.
Returns:
A dictionary containing the result of the delete operation.
|
| get_modal_profileA | Show the active Modal profile and all configured profiles (`modal profile current`
+ `modal profile list`). Use this to confirm which workspace/account the server is
authenticated as before running account-scoped operations.
Returns:
A dictionary with the active profile name and the parsed JSON list of profiles.
|
| list_modal_environmentsA | List all environments in the current Modal workspace (`modal environment list`).
Environments are sub-divisions of a workspace (e.g. "dev" vs "production"), each with
its own apps and secrets. The names returned here are valid `env` arguments for the
other tools.
Returns:
A dictionary containing the parsed JSON list of environments.
|