append_to_array
Append a value to a JSON, YAML, or TOML array or Python module-level list, preserving inline or multiline layout, comments, and trailing commas.
Instructions
Append a value to a JSON, YAML or TOML array or a Python module-level
list. The value follows the array's layout: an inline array stays
inline ([1, 2] becomes [1, 2, 3]), one element per line gets a new
line, and a trailing comma is kept. Comments are not elements: the
comma goes before them.
Use this when: adding a list item. Don't use this when: adding a key-value pair (add_key).
Example: target="project.dependencies" value='"new-package"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | Value as source text in the file's syntax, strings quoted (e.g. '"2.0.0"' or '42'). | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |