Skip to main content
Glama

Surgical find/replace in one file

update_file_content
Destructive

Apply one or more literal find/replace edits to a single file on the site, in one tool call. Designed for tiny edits where uploading the full file would be wasteful (one nav-button reference, one encoding fix, one env var bump). Each edit must specify how many matches it expects; mismatches abort the whole call with NO writes. For dist edits the change goes live immediately; for source edits you still need to call build_and_deploy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSite name.
pathYesFile-relative path inside the chosen target tree.
editsYesOrdered list of edits to apply atomically. Each is `{find, replace, count?}`. If any edit's match count doesn't equal its expected count, the whole call aborts with no writes.
targetNoWhich tree to edit. 'dist' (default) edits the served file directly — visitors see the change immediately. 'source' edits the editable source tree; you'll need build_and_deploy (or it short-circuits via noBuild) to ship.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathYes
editsYes
siteIdYes
targetYes
afterBytesYes
request_idNoServer-assigned request correlation id. Quote it when contacting support.
beforeBytesYes

TDQS

A4.9/5.0
Behavior5/5

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

Discloses atomicity (all-or-nothing), no writes on match count mismatch, and immediate vs deferred deployment. Annotations already indicate destructiveHint=true, but description adds context beyond annotations without contradiction.

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 sentences, no redundancy. Front-loaded with purpose. Every sentence adds necessary information.

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?

Comprehensive: covers usage, edge cases (mismatch abort), deployment paths, and differentiation from siblings. Output schema exists but description doesn't need to detail return values.

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?

Schema coverage is 100%, but description adds value by explaining behavior of 'count' parameter (specify expected matches, abort on mismatch) and 'target' enum (dist vs source implications). Reinforces literal vs regex for find.

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?

Clearly states verb 'apply', resource 'literal find/replace edits to a single file', and scope 'in one tool call'. Differentiates from sibling tools like 'add_files' by focusing on surgical edits rather than full upload.

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 'Designed for tiny edits where uploading the full file would be wasteful'. Mentions when to use (tiny edits) and implicit alternatives (full upload via other tools). Also explains dist vs source deployment requirements.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.2/5.0
Disambiguation5/5

Every tool has a clearly distinct purpose, from deployment and file management to domain configuration and analytics. Even similar-sounding tools like add_files and add_file_chunk are well-differentiated by context and use case.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case (e.g., add_custom_domain, list_sites, delete_source_file). The naming is predictable and easy to understand.

Tool Count4/5

39 tools is higher than the typical 3-15 range, but each tool serves a necessary function for a comprehensive deployment platform. The count is justified by the broad feature set, though slightly heavy.

Completeness5/5

The tool set covers the full lifecycle of site deployment, management, backup, custom domains, form handling, analytics, and source editing. There are no obvious gaps for the intended functionality.