Skip to main content
Glama
t0knight
by t0knight

patch_js_objects

Execute targeted string replacements inside JavaScript object bodies to update values without rewriting entire objects. Each edit specifies a target object, old string, new string, and optional replace-all behavior.

Instructions

Make targeted string replacements in JS object bodies without rewriting them.

Each edit is `{"target_id", "old", "new", "replace_all"?}` where `target_id`
is a JS object id. `old` is matched literally; if it occurs more than once the
edit fails unless `replace_all` is true (then every occurrence is replaced).

Per-edit result reports `replacements` (count) or an `error` (target not
found / `old` not found / ambiguous match).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editsYes
Behavior4/5

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

With no annotations provided, the description adequately discloses key behaviors: literal matching, failure on multiple occurrences unless replace_all is true, and per-edit result reporting. It does not cover all potential side effects or idempotency, but it gives sufficient detail for safe invocation.

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?

The description is extremely concise: two sentences plus a terse bullet-like explanation of the edit format and result structure. Every sentence adds value, and the most important information (what the tool does) is front-loaded.

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

Completeness5/5

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

Given no output schema, the description explains the per-edit result (replacements count or error), which is essential. It also clarifies edge cases (multiple occurrences causing failure). For a tool with one parameter and straightforward behavior, this is complete.

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?

The input schema only defines 'edits' as an array of objects with no further details. The description compensates fully by explaining the required fields (target_id, old, new) and optional replace_all, along with match behavior. This is critical for correct parameter usage.

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 tool's purpose: making targeted string replacements in JS object bodies. It uses a specific verb ('make targeted string replacements') and identifies the resource ('JS object bodies'), distinguishing it from sibling tools like update_js_objects that likely rewrite entire objects.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'without rewriting them', suggesting it's for targeted edits rather than full rewrites. However, it does not explicitly state when to use this tool versus siblings (e.g., update_js_objects), nor does it provide exclusions or alternative scenarios.

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/t0knight/appsmith-mcp'

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