ssh_dir_mkdir
Create a directory on a remote Linux, macOS, or Windows system via SSH, with optional sudo and Unix permissions.
Instructions
Create a directory on the remote system.
Parent-directory creation and mode behavior differ by platform/sudo:
Linux/macOS,
use_sudo=False(default): uses SFTPmkdir, which is NOT recursive - this FAILS if the parent directory doesn't already exist.modeapplies to the created directory.Linux/macOS,
use_sudo=True: usesmkdir -p -m <mode>, which DOES create any missing parent directories.Windows: always creates missing parent directories (
New-Item -Force, regardless ofuse_sudo, which has no effect on Windows anyway). Themodeparameter is IGNORED entirely on Windows - there's no equivalent to Unix octal permissions there.
Returns:
{'status': 'success', 'path', 'mode' (octal string - reflects the requested mode even on Windows, where it was actually ignored), 'message', 'connection'} on success. Raises an exception on failure (e.g. missing
parent directory without sudo on Linux/macOS).
Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Directory permissions (octal) | |
| path | Yes | Directory path to create | |
| use_sudo | No | Use sudo for the operation |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||