Skip to main content
Glama

delete_key

Remove key-value pairs from dict-like containers in JSON, YAML, TOML, and Python files while maintaining file validity by handling adjacent commas and syntax.

Instructions

Delete a key-value pair from a dict-like container. Works for JSON/YAML/TOML AND Python module-level dict literals. For JSON, also removes the adjacent comma to keep the file valid.

For JSON/YAML/TOML: target is the dotted path to the key (e.g. 'dependencies.mcp'). For Python (.py): target is 'DictName.keyExpr' where keyExpr is the literal key as it appears in source (e.g. 'CONFIG."timeout"').

Use this when: You want to remove an entire dict entry. Don't use this when: You want to remove an item from a list/array -> use remove_from_array.

Example (JSON): target="dependencies.tree-sitter" Example (Python): target='CONFIG."timeout"'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing format-specific behaviors: works for JSON/YAML/TOML/Python, explains path syntax differences between formats, and mentions JSON-specific cleanup ('removes the adjacent comma to keep the file valid'). However, it doesn't mention error handling, permissions, or what happens if the key doesn't exist.

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?

Perfectly structured with zero waste: first sentence states purpose, second explains format support, third provides JSON-specific behavior, then format-specific syntax rules, followed by usage guidelines with alternatives, and concrete examples. Every sentence adds essential information.

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?

For a 2-parameter mutation tool with no annotations but an output schema, the description provides excellent context about what the tool does, when to use it, and parameter semantics. It's nearly complete, though it could mention what the output contains (but the output schema handles that). The main gap is lack of error/edge-case behavior disclosure.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate fully. It provides rich semantic context for the 'target' parameter with format-specific syntax examples (JSON: 'dependencies.mcp', Python: 'CONFIG."timeout"'), explaining what the parameter represents and how it varies by file type. The 'file_path' parameter's purpose is implied through context.

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?

The description clearly states the specific action ('Delete a key-value pair') and resource ('from a dict-like container'), distinguishing it from siblings like 'remove_from_array' which handles list/array operations. It specifies the exact scope of deletion operations across multiple file formats.

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?

Explicitly states 'Use this when: You want to remove an entire dict entry' and 'Don't use this when: You want to remove an item from a list/array -> use `remove_from_array`', providing clear when-to-use and when-not-to-use guidance with named alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kambleakash0/agent-skills'

If you have feedback or need assistance with the MCP directory API, please join our Discord server