Skip to main content
Glama

daz_execute

Execute DazScript code in DAZ Studio to automate scene manipulation, morph discovery, animation, and rendering. Returns results and print output.

Instructions

Execute inline DazScript code in DAZ Studio.

Scripts run in the DAZ Studio JavaScript environment. Global objects: Scene (DzScene), App (DzApp), MainWindow.

⚠️ CRITICAL GOTCHAS - READ BEFORE WRITING SCRIPTS:

  1. ❌ NEVER use Action classes (DzNewCameraAction, DzNewLightAction, etc.) They pop modal dialogs and cause TIMEOUTS. ✅ Use direct constructors: new DzBasicCamera(), new DzSpotLight()

  2. ❌ NEVER set "Point At" property for camera/light aiming. ✅ Use: node.aimAt(new DzVec3(x, y, z))

  3. ✅ Wrap scripts returning values in IIFE: (function(){ return Scene.getNumNodes(); })()

  4. ✅ Environment node is ALWAYS Scene.getNode(1) - not findNodeByLabel()

For detailed examples and documentation, use the daz_script_help tool first.

Args: script: DazScript (JavaScript) source code to execute. args: Optional JSON object accessible in script as args variable.

Returns: Object with keys: success, result, output (list of print() lines), error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
argsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, description fully discloses behavior: scripts run in JS environment with Scene, App, MainWindow global objects; warns that Action classes cause modal dialogs and timeouts; provides workarounds for aiming and wrapping IIFE. Also describes return format.

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?

Well-structured with bullet points for gotchas, front-loaded with basic purpose. Slightly verbose due to detailed gotchas, but each sentence earns its place given the tool's complexity. Could be trimmed slightly.

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?

Given the tool's complexity (executing arbitrary code), the description is complete: covers purpose, global objects, critical pitfalls, parameter semantics, return structure, and references a documentation tool. Output schema exists, so return details are acceptable.

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?

Schema coverage is 0%, so description adds full meaning: script is source code, args is optional JSON accessible as `args` variable. This is critical for correct usage.

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?

Clearly states it executes inline DazScript code in DAZ Studio. Distinguishes from siblings like daz_execute_file (file-based) and daz_validate_script (validation). The verb 'execute' is precise, and resource 'DazScript' is specific.

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?

Provides explicit critical gotchas (what to avoid) and instructs to use daz_script_help for documentation. Implies when to use this tool (inline scripts) vs alternatives (e.g., daz_execute_file for files), though not explicitly listing exclusions. Clear context for safe usage.

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/bluemoonfoundry/daz-mcp-server'

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