> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# builtin__save_agent

> Validates a drafted agent file, saves it to the project's agents directory, and loads it immediately.

* Checks keys, model role, tool patterns, subagents, handoffs, schemas and prompt templates.
* Won't replace an existing file unless `overwrite` is true.

| Available to | Effect |
| - | - |
| Any agent or plan step | Has side effects |

## Input

**overwrite** `boolean`

Replace an existing file with the same name, only after the user confirms

**yaml** `string` *required*

The whole agent file

## Output

**error** `string`

**path** `string`

**problems** `string[]`

**saved** `string`

```yaml Plan step theme={null}
- id: E1
  tool_name: builtin__save_agent
  input:
    yaml: "{{input.yaml}}"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.