edit_document
Edit a Huly document by updating its title and body using full markdown replacement or targeted text search-and-replace.
Instructions
Edit an existing Huly document. You may rename with title and/or edit the body. Body editing has two mutually exclusive modes: (1) content replaces the entire markdown body, (2) old_text + new_text performs exact targeted search-and-replace. Use markdown links to current-workspace Huly browse URLs for native references; Huly browse links returned in get_document content round-trip as native references. The URL identifies the object; link text is display text; plain issue keys stay text. External URLs stay normal markdown links. For targeted replace, multiple matches error unless replace_all is true; empty new_text deletes matched text. Content supports native Mermaid diagrams. Returns a 'url' field pointing to the document in the Huly web app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamspace | Yes | a string that will be trimmed | |
| document | Yes | a string that will be trimmed | |
| title | No | a string that will be trimmed | |
| content | No | Full replacement content (markdown). Mutually exclusive with old_text/new_text. | |
| old_text | No | Exact text to find in the document. Must be non-empty. Mutually exclusive with content. | |
| new_text | No | Replacement text. Empty string deletes the matched text. Required when old_text is provided. | |
| replace_all | No | Replace all occurrences of old_text (default: false). Only used with old_text/new_text. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The successful tool result. The same value is also serialized as JSON in the text content for clients that do not read structuredContent. | |
| warnings | No | Optional agent-visible warnings about degraded result fidelity. Omitted when the server returned the documented happy-path payload. |