Skip to main content
Glama

remove_from_array

Destructive

Removes the first matching value from a JSON, YAML, or TOML array or Python module-level list while preserving comments and trailing-comma style; use it to delete one list item.

Instructions

Remove the first element matching value_match from a JSON, YAML or TOML array or a Python module-level list. An element on a line of its own goes with that line and its comment; other comments stay. The trailing-comma style is kept, and removing the only element leaves [].

Use this when: removing one list item. Don't use this when: removing a whole key (delete_key).

Example: target="project.dependencies" value_match='"old-package"'

Input Schema

NameRequiredDescriptionDefault
targetYesKey path from the top level to a JSON, YAML or TOML array ('project.dependencies'), or a Python module-level list's name.
file_pathYesAbsolute path to the source or config file.
value_matchYesElement to remove, compared with each element's source text, whitespace stripped (e.g. '"old-package"').

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 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 to a JSON, YAML or TOML array ('project.dependencies'), or a Python module-level list's name."
    • addedInput schema / properties / value_match / description
      Added value: +"Element to remove, compared with each element's source text, whitespace stripped (e.g. '\"old-package\"')."
  2. First observedv2.0.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, and the description goes well beyond them: only the first match is removed, the element's own line and comment are removed while other comments stay, trailing-comma style is preserved, and removing the sole element yields `[]`. The one gap is behavior on no-match (no-op, error, or silent success), which matters for a destructive edit.

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 semantics, then a matching-detail paragraph, then structured Use/Don't-use lines and a compact example. Every sentence carries actionable information; nothing is filler.

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, so return values need no explanation, and the formatting/matching rules are unusually complete. The missing piece is failure behavior when value_match matches nothing and whether matching is case- or whitespace-sensitive beyond the stated whitespace-stripped comparison.

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 coverage is 100%, so the baseline is 3, and the description largely restates the documented parameters via the example (target, value_match). It does add one non-obvious semantic — that only the first matching element is removed rather than all matches — which is why it holds at the baseline rather than dropping.

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 precise verb+resource: 'Remove the first element matching value_match from a JSON, YAML or TOML array or a Python module-level list.' It also names the sibling it must not be confused with (delete_key), so an agent can select it without opening any 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?

Contains explicit 'Use this when: removing one list item' and 'Don't use this when: removing a whole key (delete_key)' clauses, giving both the positive trigger and the exclusion with the named alternative.

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