Skip to main content
Glama

remove_from_array

Removes the first occurrence of a value from an array in JSON, YAML, TOML configs or Python module-level lists. Specify the target path or variable name and the value to match.

Instructions

Remove the first element matching value_match (stripped text equality) from an array/list. Works for JSON/YAML/TOML config arrays AND Python module-level list literals.

For JSON/YAML/TOML: target is the dotted path to the array. For Python (.py): target is the module-level variable name.

Use this when: You want to remove a specific item from a list. Don't use this when: You want to remove a whole key -> use delete_key.

Example (TOML): target="project.dependencies" value_match='"old-package"' Example (Python): target="ITEMS" value_match='"old-item"'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
value_matchYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Explains 'stripped text equality' and target semantics for different file types. But does not disclose error behavior (e.g., if value not found), side effects, or idempotency. No annotation provided so description carries the burden.

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

Conciseness4/5

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

Well-structured with main action, format notes, usage guidelines, and examples. Moderate length, front-loaded. Could be slightly more concise but overall efficient.

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

Completeness3/5

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

Covers main use cases and target formats. But missing return value description (though output schema exists but not shown) and error handling. Does not mention what happens if value not found or if file is read-only.

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

Parameters4/5

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

With 0% schema coverage, description adds significant meaning: explains target as dotted path or variable name, value_match as stripped text equality. Provides examples for TOML and Python. However, file_path is not described.

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?

Description clearly states the action: remove first matching element from an array/list. It specifies supported formats (JSON/YAML/TOML and Python) and distinguishes from sibling delete_key.

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 says 'Use this when:' and 'Don't use this when:' with a clear alternative (delete_key). Provides example contexts for different file types.

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