mktemp
Create temporary files or directories with unique names to prevent race conditions. Ideal for safe temporary workspace creation in agent workflows.
Instructions
Create temporary files or directories with unique, unpredictable names atomically to prevent race conditions. Destructive: creates files/dirs on the filesystem. Returns JSON with the created path. Supports prefix and suffix for naming control. Use for safe temporary workspace creation in agent workflows. Not for persistent directories — use 'mkdir'. See also 'mkdir'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prefix | No | Temporary path prefix. | tmp. |
| suffix | No | Temporary path suffix. | |
| tmpdir | No | Directory where the temporary path should be created. Defaults to cwd. | |
| dry_run | No | Report a candidate path without creating it. | |
| directory | No | Create a temporary directory. |