Skip to main content
Glama
ykovenskiy-hub

Purl MCP Server

edit_script

Apply targeted find/replace edits to existing scripts with unique anchors; the whole edit is rejected if any anchor fails, preventing accidental overwrites.

Instructions

Edit an existing script via a list of find/replace anchors — the safe way to change part of a script without overwriting unrelated lines. Each edit's "old" string must match exactly once in the current content (or set replaceAll: true to replace every occurrence). Edits are applied sequentially in the order supplied; each later edit operates on the result of the previous. Atomic: if any anchor fails to match (zero or multiple), the whole call is rejected with line numbers — nothing is written. Use this for targeted changes; use update_script only for full rewrites or brand-new scripts. Stale baselines fail loudly because the anchor either matches today's content (safe) or doesn't (rejected).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editsYesOrdered list of find/replace edits. Sequential — later edits see earlier results.
promptYesTHE USER'S EXACT PROMPT — verbatim, word-for-word, as typed. Do not summarize, paraphrase, translate, or shorten. Copy the user's message into this field exactly. Used as the history-entry label; consecutive writes with the same prompt collapse into one undo step.
targetYesObject name (e.g., "Player") or "cell:CellName" for cell scripts
cellNameNoOptional: restrict object lookup to this cell when the same object name exists in multiple cells.
validateNoOptional: when true, parse the post-edit content with the full DSL parser before writing. If parsing fails, the edit is rejected with line/column diagnostics and the existing script is unchanged. Default false (matches legacy behavior). Recommended whenever you are not certain the result parses.
scriptNameNoScript slot to edit (default: "Main"). Required if the target object has multiple scripts.
Behavior5/5

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

Despite lacking annotations, the description fully discloses behavioral traits: sequential application of edits, atomicity ('if any anchor fails... nothing is written'), and loud failure on stale baselines. It also mentions the optional validate flag, adding important context beyond the schema.

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 compact and front-loaded with the core purpose. Every sentence adds critical information—mechanics, atomicity, usage distinction, and failure behavior—with no redundancy or filler.

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?

The tool has 6 parameters and no output schema, but the description covers key behavioral aspects (replaceAll, sequential application, atomicity, validation), alternatives, and edge cases. It is fully sufficient for an agent to select and invoke the tool correctly.

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%, so the baseline is 3. The description adds meaningful semantics: it explains sequential edit ordering, the uniqueness requirement for 'old', the effect of replaceAll, and the atomic rejection behavior, which goes beyond the schema's field-level descriptions.

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 begins with a specific verb and resource: 'Edit an existing script via a list of find/replace anchors'. It clearly defines the method (anchored find/replace) and contrasts with update_script, making the tool's unique purpose obvious.

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?

Explicit guidance is provided: 'Use this for targeted changes; use update_script only for full rewrites or brand-new scripts.' It also explains when to use replaceAll and the consequences of stale baselines, giving clear when-to-use and when-not-to-use context.

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/ykovenskiy-hub/purl-mcp'

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