Skip to main content
Glama

Edit build script

edit_script
Destructive

Edit a saved script and re-run it, updating the SAME gallery build. Use for every refinement instead of rewriting. Redo a section by line range (numbers from read_script). {search, replace} is for small changes; search must exist verbatim — to ADD code, search an existing anchor line and put anchor + new code in replace. edits:[] just re-runs (new params/volume). Volume and origin are inherited; expandMargin grows them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "scriptId": "<scriptId>",
      "edits": "<edits>"
    },
    "name": "edit_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoGallery title.
tagsNo
depthNo
editsYesEach is {search, replace} OR {startLine, endLine, replace}.
modelNoYour model id.
widthNo
heightNo
paramsNoparam() values. Omitted = the saved ones (gallery sliders); {} = defaults.
originXNo
originYNo
originZNo
rendersNoAs in execute_script; [] = none. Keep few.
timeoutNoms (default 30000).
scriptIdYesFrom execute_script.
unlistedNo
editPromptNoEVERY edit: why — the user's own words when given ("roof too flat"), else your reason. Saved as failure→fix data.
showImagesNofalse: render URLs only.
userPromptNo
baseBuildIdNoOmit to keep the current base build; "" drops it.
checkParamsNoAs in execute_script.
expandMarginNoN blocks of room on every side (volume +2N, origin +N): fixes clipping at any edge.
enhancedPromptNo

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false; the description adds the non-obvious behavior that the same gallery build is mutated and that volume/origin are inherited unless expandMargin grows them. It doesn't cover reversibility or what happens to the prior build version, which matters given destructiveHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then edit-mode selection, then inheritance, so the most decision-relevant facts come first. It is telegraphic in places ("to ADD code, search an existing anchor line") and could be tightened, but every sentence carries signal.

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 22-parameter destructive mutation with no output schema, the description covers the hard parts: edit semantics, re-run mode, and volume/origin inheritance. Peripheral params (name, tags, renders, unlisted, editPrompt) are left to the schema, which is acceptable given their descriptions.

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?

With 22 params at 55% schema coverage, the description earns credit: it explains the two edit shapes (line range from read_script numbering vs. {search, replace}), that search must match verbatim, and the exact workaround for adding code. It also clarifies edits:[] re-runs and that volume/origin inherit while expandMargin expands them.

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?

"Edit a saved script and re-run it, updating the SAME gallery build" gives a specific verb (edit + re-run), resource (saved script), and an explicit outcome (in-place build update). The contrast with "rewriting" implicitly separates it from execute_script, which creates a fresh build.

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

Usage Guidelines4/5

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

It states a clear default policy: "Use for every refinement instead of rewriting," and shows the re-run-only case via `edits:[]`. It routes away from rewriting without naming the sibling tool outright, which leaves a small inference step.

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.

Resources