Skip to main content
Glama

delete_key

Destructive

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

NameRequiredDescriptionDefault
targetYesKey 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_pathYesAbsolute path to the source or config file.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.2.0
    • addedInput schema / properties / file_path / description
      Added value: +"Absolute path to the source or config file."
    • addedInput schema / properties / target / description
      Added value: +"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')."
  2. First observedv1.2.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and openWorldHint=false, so safety is covered; the description goes further and discloses the concrete side effects of deletion — adjacent comma removal, `{}` left behind for the last entry, line removal for YAML/TOML. It stops short of saying what happens if the target key does not exist (error vs. no-op), which is the one behavioral detail still missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then syntax consequences, then the use/don't-use routing block, then a single example. Every sentence carries distinct information and the sectioning makes it scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and annotations cover the safety profile, so return values and risk need not be explained. Parameters are fully documented. The only remaining gap is failure semantics for a missing key, which matters for a destructive edit but is not stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the `target` parameter already documents the dotted-path and quoted-key syntax. The description's example (`target='CONFIG."timeout"'`) illustrates the same format but adds no new constraint or edge case beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (delete a key-value pair) and immediately bounds the scope to config files and Python/JS/TS module-level dicts/object literals. It explicitly names the siblings it is not (remove_from_array, delete_in_body), so an agent can route correctly without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Uses explicit 'Use this when' / 'Don't use this when' sections with two named alternatives and the exact condition that selects each. This is the strongest form of routing guidance and leaves nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.