# willo_write_file

> Create a file, or replace a whole existing file, in the business's site code on GitHub.

Generated from Willo's code at each release.

Source: https://www.willo.ai/docs/reference/mcp-tools/willo_write_file

**Write a site file.** Lands on the `draft` branch while the business is drafting (nothing is live until a person publishes); when drafting is OFF it lands on `main` and the LIVE site rebuilds at once (willo_status shows whether drafting is on). Replacing an existing file REQUIRES its `sha` from willo_read_file — a missing or stale sha is refused, so you never overwrite what you have not read; to change part of a file use willo_edit_file. Runs without a card like Willo's chat, EXCEPT package.json and lockfiles: a dependency change needs a person's approval (`pending_approval` + link; call again with the same arguments after). Refused: build, CI, hosting and package-manager config files, git internals (the refusal names the file), and any secret-shaped value (keys and tokens never go in site files). Each change can be undone from the dashboard. If a live deploy fails, Willo does not auto-fix it: you do.

## Access

- **Token**: read + act, and editor access or higher on the business.
- **Approval**: Only when Willo's chat would stop for the same action. The description says when; otherwise the call runs at once.
- **Secret scan**: refused if the new content holds a value shaped like an API key or token.
- **Metered**: counts toward a per-business, per-minute limit for this kind of call. See [Limits](https://www.willo.ai/docs/reference/limits).

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `path` | string | yes | Repo-relative path, e.g. `src/pages/pricing.astro`. |
| `content` | string | yes | The whole file, exactly as it should be. |
| `sha` | string | no | The file's `sha` from willo_read_file. Required to replace an existing file; omit to create a new one. |
| `summary` | string | no | One plain sentence for the owner on what this does for them (shown in the dashboard and the commit). |

## Related

- [All MCP tools](https://www.willo.ai/docs/reference/mcp-tools)
- [Error codes](https://www.willo.ai/docs/reference/errors)
- [Draft and live](https://www.willo.ai/docs/ai-agents/draft-and-live)
