modal_volume_files
Perform file operations on Modal volumes: upload, download, copy, and delete files with recursive and force options.
Instructions
Write operations on a volume's files. To LIST a volume's contents use
list_modal_resources(resource="volume_files").
Args:
action: "put" (upload local_path → remote_path), "get" (download remote_path →
local_path; "-" returns the contents instead of writing a file), "cp" (copy
inside the volume, using `paths`), "rm" (delete remote_path).
volume_name: Volume name.
local_path: Local source ("put") or destination ("get", default ".").
remote_path: In-volume destination ("put", default "/", trailing "/" keeps the
filename), source ("get"), or target ("rm").
paths: For "cp": sources followed by the destination, e.g. ["a.txt", "dest/"].
recursive: Needed to "rm" or "cp" a directory.
force: Overwrite existing files ("put"/"get").
env: Modal environment the volume lives in.
Returns: {message, stdout, stderr} or {error}. When MCP_MODAL_ALLOWED_LOCAL_PATHS is
set, "put"/"get" are refused for local paths outside the allowlist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| force | No | ||
| paths | No | ||
| action | Yes | ||
| recursive | No | ||
| local_path | No | ||
| remote_path | No | ||
| volume_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |