> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-mcp/tool-reference/projects-and-workflow-authoring/projects-edit.md).

# projects\_edit

Change an existing project draft using a natural-language instruction or an exact patch.

**Effect:** This call saves data or changes configuration. Review the behavior below before using it.

## Inputs

Supply **exactly one** of `description` and `direct_patch`, in addition to `project_id`.

| Name           | Type                      | Requirement          | Description                                                                                                                                    |
| -------------- | ------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_id`   | string                    | Required             | ID returned by `projects_list`; use a project in the active organization.                                                                      |
| `publish`      | boolean                   | Optional             | Default `false`. Set `true` only to publish the resulting draft.                                                                               |
| `description`  | string                    | Exactly one required | Natural-language change instructions. Supply this or `direct_patch`, not both.                                                                 |
| `direct_patch` | array of patch operations | Exactly one required | Structured operations: `add_node`, `remove_node`, `update_node`, `add_edge`, `remove_edge`. Exactly one of this and `description` is required. |
| `dry_run`      | boolean                   | Optional             | Default `false`. `true` previews a direct patch without saving. Not supported in description mode.                                             |

## Example

These are MCP tool arguments, not an HTTP request body. Replace bracketed IDs with values returned from your account.

```json
{
  "project_id": "<project-id>",
  "description": "Keep the existing inputs and integrations. Update the response instructions to distinguish facts from missing information.",
  "publish": false
}
```

## Result

Abbreviated result example; unshown fields are omitted for clarity.

```json
{
  "flow_id": "<project-id>",
  "published": false,
  "dry_run": false,
  "edit_strategy": "description",
  "publish_error": null
}
```

## Behavior

Description mode uses AI; direct\_patch applies structured operations.

Read the current draft first.

Set publish=false explicitly while iterating; publish=true attempts to replace the published version. dry\_run=true is supported only with direct\_patch and writes nothing.

Inspect delta, action\_param\_corrections, published and publish\_error; a saved draft is not proof of publication.

The result identifies the project as flow\_id.

## Troubleshooting

If the patch is rejected, use the returned operation index and suggested fix, read the draft again, and preview the corrected patch. If publication fails, inspect `publish_error`: the draft may still have been saved.

## Related resources

[Projects and workflow authoring](https://docs.stackai.com/stackai-mcp/tool-reference/projects-and-workflow-authoring.md)

[Edit, validate and publish deliberately](https://docs.stackai.com/stackai-mcp/workflow-recipes/edit-validate-and-publish-deliberately.md)

[Connection, permissions, pagination, and recovery](https://docs.stackai.com/stackai-mcp/best-practices-and-troubleshooting.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-mcp/tool-reference/projects-and-workflow-authoring/projects-edit.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
