Skip to main content
Glama

run_script

Destructive

Executes DazScript inside Daz Studio to handle tasks not covered by named tools, using optional args and returning a JSON result.

Instructions

Runs DazScript inside Daz Studio for anything the named tools do not cover. Globals: Scene, App, MainWindow, DazMcp (helpers such as DazMcp.findNode, DazMcp.log). Use DazMcp.log(msg) for messages and return the result.

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": {
      "code": "<code>"
    },
    "name": "run_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoObject available to the code as `args`.
codeYesDazScript (ES5 JavaScript) run as a function body; `return` a JSON value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and openWorldHint=false, so the agent knows this mutates state. The description adds genuinely new runtime context the annotations can't express (available globals and DazMcp.log for output), but it never warns that arbitrary code executes with full application privileges and is not inherently undoable — the single most important behavioral fact for a destructive escape hatch.

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?

Three short sentences, front-loaded with the action and the scoping rule, with no filler. The globals sentence is dense but earns its place as practical authoring guidance; the ellipsis-style "such as" keeps it from bloating.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive arbitrary-code-execution tool with no output schema, the definition covers the execution environment but omits error behavior, whether failures roll back, and any caution about irreversible scene changes. Given 100% schema coverage the gaps are tolerable, but a warning sentence would materially improve safety.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are already documented, and the description's note about `return`-ing a JSON value adds a little meaning about the `code` body. The globals list informs how to write code but does not deepen the parameters themselves, so baseline 3 is right.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Runs DazScript inside Daz Studio") and frames itself as the escape hatch for work the named tools don't cover. That framing distinguishes it from the enumerated domain tools without naming any single sibling, which is a mild but real differentiation.

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?

"for anything the named tools do not cover" gives an explicit selection rule: use the purpose-built tools first, fall back to this one. It stops short of stating when not to use it or any precondition (e.g., that arbitrary code affects live scene state), so it is clear context but not a full routing rule.

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