Skip to main content
Glama

ParCAD

Replace the script on screen

set_script
DestructiveIdempotent

Replaces the whole script of the project open on the user's screen, for a script that is new from the first line. edit_part with project "@session" changes only the lines it names, builds them first and lands on screen the same way. A different part is shown with save_project and open_project; a script sent here lands in the open project, and a save writes it there. The change appears in every window immediately and lands in the editor's normal undo history, so the user can Cmd-Z it back like their own typing; there is no lock. It edits the screen only: nothing is written to disk until the user saves or save_project is called. A script that does not build replaces the user's working part on screen with an error; evaluate_part builds a script without showing it. The script replaces anything the user typed since get_session last returned the text.

The reply waits (up to wait_s, default 20 s) until a window reports evaluating this revision, and its viewers lists each window with the revision it showed and whether it built: with which volume_mm3, or the error it hit. It does not echo the script: script_chars and script_sha256 identify what landed, and get_session returns it whole. Setting the same script again makes every window evaluate it again, which recovers a window that is showing something stale.

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": {
      "script": "<script>"
    },
    "name": "set_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYesThe DSL source to put on screen, whole — this replaces the open document, it does not append to it.
wait_sNoHow long to wait, in seconds, for a window to report that it evaluated this revision. 0 to 60; defaults to 20. The reply comes as soon as one does, or when the time is up with `viewers` saying where each window got.

Output Schema

NameRequiredDescriptionDefault
nameYes
originYes
scriptNo
viewersYes
revisionYes
script_charsYes
script_sha256Yes
shown_in_chatNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Far beyond the annotations: it discloses that the change hits every window immediately, enters the editor's undo history (Cmd-Z recoverable), takes no lock, and is screen-only until save_project or a user save. It also warns that a non-building script replaces the user's working part with an error, and that the call overwrites anything typed since get_session last returned text. Only minor gaps remain, such as what the error payload looks like beyond the `error` field.

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 the core action and the edit_part contrast, then behavior, then the reply contract — a sensible ordering. It is dense but three paragraphs with a little redundancy: save_project/open_project is mentioned twice, and the disk-write point is restated.

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?

Complete for a destructive, screen-mutating tool: it covers permissions/locking, undo, persistence boundary, failure mode, concurrency over overwritten edits, and timeout behavior. The return shape is described enough to interpret `viewers`, `script_chars` and `script_sha256` even though an output schema exists.

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, but the description adds meaning about `wait_s` (waits up to wait_s default 20 s until a window reports evaluating this revision) and what the wait resolves into (`viewers` with per-window revision/built status). For `script` it reinforces that the whole source must be sent, matching the schema's 'does not append to it.'

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?

Opens with a specific verb and scope: 'Replaces the whole script of the project open on the user's screen, for a script that is new from the first line.' It immediately names the sibling it differs from (edit_part) and how that one differs, so an agent can separate whole-document replacement from line-level editing without consulting either schema.

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?

Gives explicit alternatives with the conditions that select them: edit_part with "@session" for line edits, save_project/open_project for a different part, evaluate_part to build without showing. It also states when re-calling is the right move ('Setting the same script again ... recovers a window that is showing something stale'), covering a non-obvious recovery case.

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.