delete_key
Delete a key-value pair from JSON, YAML, TOML, Python, or JS/TS files. Automatically removes the trailing comma to maintain syntax validity.
Instructions
Delete a key-value pair from a dict-like container.
JSON / YAML / TOML: dotted path to the key.
Python (.py) module-level dict literals: target is 'DictName.keyExpr' (e.g. 'CONFIG."timeout"').
JS / TS module-level
const/let/varobject literals (includingexport const ... = { ... }): target is 'VarName.keyName' or 'VarName."quoted-key"'. Handles both regular{ key: value }pairs and shorthand{ key }properties.
For JSON and JS/TS, the adjacent comma is also removed to keep the file valid.
Use this when: You want to remove an entire entry.
Don't use this when: You want to remove an item from a list/array -> use
remove_from_array. You need to edit an inline object literal passed as a
function argument (foo({ x })) -- use delete_in_body (Phase 3) scoped
to the enclosing function instead.
Example (JSON):
target="dependencies.tree-sitter"
Example (Python):
target='CONFIG."timeout"'
Example (TS):
target="CONFIG.port" # regular pair
target="CONFIG.name" # shorthand { name }
target='CONFIG."complex-key"' # quoted key
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |