modal_volume_files
Upload, download, copy, or delete files in a Modal volume to manage its contents. Handles recursive directory operations, overwrites, and per-call environment or profile selection.
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.
profile: Modal profile for this call only. Defaults to the active profile.
Returns: {message, stdout, stderr} or {error}. When MCP_MODAL_ALLOWED_LOCAL_PATHS is
set, "put"/"get" are refused for local paths outside the allowlist.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>",
"volume_name": "<volume_name>"
},
"name": "modal_volume_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| force | No | ||
| paths | No | ||
| action | Yes | ||
| profile | No | ||
| recursive | No | ||
| local_path | No | ||
| remote_path | No | ||
| volume_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |