delete_key
Delete a key-value pair from config files or Python/JS/TS module-level dicts or object literals, handling adjacent commas and leaving empty objects when the last entry is removed.
Instructions
Delete a key-value pair from a config file, or from a Python or JS/TS
module-level dict or object literal. The adjacent comma goes too where
the syntax has one, and deleting the only entry leaves {}; YAML and
TOML keys otherwise go with their lines.
Use this when: removing a whole entry. Don't use this when: removing a list item (remove_from_array), or an entry of an object literal passed as an argument (delete_in_body).
Example: target='CONFIG."timeout"'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Key path from the top level in a config file ('dependencies.tree-sitter'; quote a key with dots, '"editor.fontSize"'), or a path into a Python or JS/TS module-level dict or object ('CONFIG."timeout"', 'CONFIG.server.port'). | |
| file_path | Yes | Absolute path to the source or config file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |