# createFolder

Canonical URL: https://developers.iagenify.com/sdk/ref/tools/create-folder/
Language: en

`tools: { create_folder: api.tools.createFolder }`

Lets a run make a folder on the caller's computer, parents included. One argument, no cost, nothing to undo.

Status: declaration only · free · creates parents

A declaration, not a function. It is the simplest of the four write tools, and the only one that cannot lose anything.

## Declaring it {#declaring}

```javascript
tools: {
  create_folder: api.tools.createFolder,
  write_document: api.tools.writeDocument,
}
```

## What the model sends {#arguments}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `path` | string | required | The folder, relative to the workspace. For example `Projects/Launch`. |

Every parent is created on the way, and a folder that is already there is left exactly as it is — so the call is safe to repeat. The answer is the folder's path.

```javascript
// What the run reports back
{ path: "Projects/Launch" }
```

## It is rarely the one you need {#rarely}

> **write_document already creates the folders of its path**
>
> Declare this one when the structure itself is the point — a tree prepared before anything is filled, an empty folder an interface will show. For writing a file, the write tool is enough, and one tool fewer is fewer tokens on every turn.

## The path rules are the workspace's {#paths}

Relative, forward slashes, and it cannot leave the workspace. An absolute path or one that climbs out is refused — see [LocalFiles](/sdk/ref/local-files) for the whole set.

> **It runs on the caller's computer, through the package**
>
> The server cannot reach a disk. When the agent calls this, the run asks the machine that holds the key to perform it, the package does the work there, and the answer goes back into the run. So it only works while your process is listening — and nothing of the file ever travels to be written.

## Refusals the run reports {#refusals}

- A missing path, or one that is not a string.
- An absolute path, or one outside the workspace.
- The workspace root itself.
- A path where a **file** already sits — the filesystem refuses, and the message says so.

- [writeDocument](/sdk/ref/tools/write-document): Writing a file, folders included.
- [files.mkdir()](/sdk/ref/local-files/mkdir): The same operation from your own code.
- [api.tools](/sdk/ref/tools): The fifteen, and the two ways to use them.

```python
tools = {
    "create_folder": api.tools.create_folder,
    "write_document": api.tools.write_document,
}
```

```python
# What the run reports back
{"path": "Projects/Launch"}
```
