remove_from_array
Removes the first occurrence of a specified value from arrays in JSON, YAML, TOML, or Python list literals using path or variable name.
Instructions
Remove the first element matching value_match (stripped text equality) from an array/list. Works for JSON/YAML/TOML config arrays AND Python module-level list literals.
For JSON/YAML/TOML: target is the dotted path to the array. For Python (.py): target is the module-level variable name.
Use this when: You want to remove a specific item from a list.
Don't use this when: You want to remove a whole key -> use delete_key.
Example (TOML): target="project.dependencies" value_match='"old-package"' Example (Python): target="ITEMS" value_match='"old-item"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| value_match | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |