Modal MCP Toolbox
run_python_code_in_sandbox
Copy
print(requests.get('https://icanhazip.com').text)", requirements=["requests"])
Input Schema
Name | Required | Description | Default |
---|---|---|---|
code | Yes | The python code to run. | |
mount_directory | No | Allows you to make a local directory available at `/mounted-dir` for the code in `code`. Needs to be an absolute path. Writes to this directory will NOT be reflected in the local directory. | |
pull_files | No | List of tuples (absolut_path_sandbox_file, absolute_path_local_file). When provided downloads the file(s) from the sandbox to the local file(s). | |
python_version | No | The python version to use. If not provided defaults to 3.13 | 3.13 |
requirements | No | The requirements to install. |