remove_from_array
Removes the first matching value from a JSON, YAML, or TOML array or Python module-level list while preserving comments and trailing-comma style; use it to delete one list item.
Instructions
Remove the first element matching value_match from a JSON, YAML or
TOML array or a Python module-level list. An element on a line of its
own goes with that line and its comment; other comments stay. The
trailing-comma style is kept, and removing the only element leaves
[].
Use this when: removing one list item. Don't use this when: removing a whole key (delete_key).
Example: target="project.dependencies" value_match='"old-package"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Key path from the top level to a JSON, YAML or TOML array ('project.dependencies'), or a Python module-level list's name. | |
| file_path | Yes | Absolute path to the source or config file. | |
| value_match | Yes | Element to remove, compared with each element's source text, whitespace stripped (e.g. '"old-package"'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |