delete_in_body
Remove a specific code snippet from inside a function body, scoped to the target function to avoid global matches, and raise an error if the snippet is not found or appears multiple times.
Instructions
Delete a byte-identical snippet inside a named function/method body. Scoped to the target's body so global file matches don't apply.
Raises if the snippet is not found, or if it appears more than once in the body (include more surrounding context to make the match unique).
Use this when: You want to remove a specific statement, block, or line
inside a function body without rewriting the whole body. Also useful for
removing a single entry from an inline object-literal passed as a function
argument -- target the enclosing function and delete the entry text.
Don't use this when: You're deleting the entire function/class -> use
delete_symbol.
Example (remove a mount call inside a function): target="RegisterRoutes" snippet='\tr.Mount("/kb", kbHandler)\n'
Example (remove a key from an inline object arg): target="main" snippet="\t\tclassification,\n"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| snippet | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |