Skip to main content
Glama

replace_value

Replace the value of an existing key in JSON, YAML, or TOML files. Use to update a key's value without adding new keys.

Instructions

Replace the value of an existing key in a JSON, YAML, or TOML file.

Use this when: A key already exists and you want to update its value. Don't use this when: The key doesn't exist yet -> use add_key. You're modifying an array -> use append_to_array or remove_from_array.

Example: target="project.version" content='"2.0.0"'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description indicates it replaces a value (implied mutation) but does not disclose potential side effects like file backup, error handling for missing files, or formatting preservation. With no annotations, it partially covers behavioral traits but lacks depth.

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?

Three concise sentences plus a focused example. No unnecessary words, efficiently conveys core 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?

Covers main use case and boundaries. Output schema is present, so return values are likely documented externally. Missing details like error handling or file validation, but overall adequate for a simple replace tool.

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 has 0% description coverage, so description must explain parameters. It provides an example clarifying target (dot-separated path) and content (new value with quotes) but does not explain file_path. Adds moderate meaning beyond schema but incompletely compensates.

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 'Replace the value of an existing key' and specifies file types (JSON, YAML, TOML). It distinguishes from siblings like add_key and array operations, making the tool's purpose unambiguous.

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 tells when to use (key exists, update value) and when not to use (key missing -> add_key, array modification -> append_to_array/remove_from_array). Provides clear alternatives for each exclusion.

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/ast-editor'

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