patch_agent_prompt
Replace a specific span inside an agent prompt, proactive message, or custom CSS without rewriting the full text. Use exact text from get_agent as old_string for surgical updates.
Instructions
Performs string replacements in the start-node prompt (or proactiveMessage / customCSS). USE THIS instead of update_agent when the prompt is large and you only need to change a specific section. If get_agent returns empty instructions, this tool REFUSES a surgical patch — it will NOT replace the whole prompt with new_string. Workflow: get_agent → copy the exact span into old_string → new_string is the replacement. Only omit old_string when the field is truly empty and new_string is the FULL prompt. target=auto patches the start node instructions. Never writes vg_instructions (API rejects it). sync_mirrors defaults false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Field to patch. auto / vg_instructions / vg_systemPrompt all write nodes[0].instructions. customCSS patches widget CSS surgically. | |
| agentId | Yes | The agent ID whose prompt/text field to patch | |
| new_string | Yes | Replacement text for the matched span. Use an empty string to delete the matched text. | |
| old_string | No | Text to find. Copy from get_agent. If the field is empty, this tool refuses a surgical patch — only omit old_string when installing a FULL prompt. | |
| replace_all | No | If false (default), fails when old_string matches more than once. If true, replaces every occurrence. | |
| sync_mirrors | No | When true, also apply the same replace to other writable prompt copies. Default false. vg_instructions / vg_systemPrompt are never written. |