remove_from_array
Remove the first matching element from a JSON, YAML, or TOML array or Python module-level list while preserving comments and trailing-comma style.
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"'
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"target": "<target>",
"value_match": "<value_match>"
},
"name": "remove_from_array"
}
}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 |