Skip to main content
Glama
ykovenskiy-hub

Purl MCP Server

update_script

Full-replace a script by writing new code as its content. Use for complete rewrites or new script slots; optional version check prevents stale overwrites.

Instructions

Full-replace a script: writes the supplied code as the new content. Use for genuine rewrites or to create a new script slot. For incremental edits to an existing script, prefer edit_script — its anchor matching catches stale baselines that update_script would silently overwrite. If you must full-replace an existing script, pass expectedVersion (from get_script or read_project_scripts) so a stale write fails loudly instead of stomping concurrent changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe script code to set
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. Required when the same object name exists in multiple cells (e.g., after duplicating a cell); otherwise the server errors with a list of candidate cells.
validateNoOptional: when true, parse the new code with the full DSL parser before writing. If parsing fails, the write is rejected with line/column diagnostics and the existing script is unchanged. Default false (matches legacy behavior). Recommended whenever you are not certain the code parses.
scriptNameNoName of the script slot (default: "Main")
expectedVersionNoOptional precondition: the version token of the script you read (from get_script's "(version: ...)" header or read_project_scripts entry.version). If supplied and does not match the current content, the write is rejected with the actual hash — prevents silently overwriting concurrent changes. Highly recommended for any full-replace of an existing script.
Behavior4/5

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

No annotations are provided, so the description must carry the transparency burden. It warns that update_script would 'silently overwrite' stale baselines and explains how expectedVersion makes failures loud, which covers the main risk. It doesn't disclose return values or permission requirements, but the core behavioral trait (full replacement) is clearly stated.

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, each earning its place: first states the action, second gives the primary use case and alternative, third advises a safety mechanism. The structure is front-loaded and avoids redundancy.

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?

For a tool with 7 params and no output schema, the description covers the key decision points: when to use, when to avoid, and how to prevent data loss. It lacks explicit mention of return values, but the schema and sibling context (e.g., get_script for version) fill the gap. Overall it is sufficiently complete for an agent to choose and safely invoke the tool.

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?

Input schema covers 100% of parameters with rich descriptions, so the baseline is 3. The description adds context around expectedVersion ('stale write fails loudly') and reiterates the danger of overwriting, reinforcing schema meaning. It doesn't introduce new parameter info, but the existing schema descriptions are already strong.

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 opens with 'Full-replace a script: writes the supplied code as the new content,' which precisely names the verb and resource. It also distinguishes itself from edit_script by stating it is for genuine rewrites or new slots, not incremental edits.

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 prescribes when to use ('genuine rewrites or to create a new script slot') and when not to ('For incremental edits... prefer edit_script'), and gives safety guidance for full-replace (pass expectedVersion). This is clear, actionable direction with an alternative.

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