Skip to main content
Glama

add_shader_graph_node

Add a concrete AbstractMaterialNode to an existing Shader Graph through GraphData, using an expected content hash to reject stale edits and auto-placing nodes on a grid when position is omitted.

Instructions

Add one concrete AbstractMaterialNode to an existing Shader Graph through GraphData. Pass contentHash from inspect_shader_graph as expectedContentHash so stale edits fail closed. When position is omitted, Creator Works MCP places the node on a 24-pixel grid to the right of the current graph without overlap. Open Shader Graph editor assets are rejected, and the original asset is restored if Unity import or shader compilation fails.

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": {
      "assetPath": "<assetPath>",
      "nodeType": "<nodeType>",
      "expectedContentHash": "<expectedContentHash>"
    },
    "name": "add_shader_graph_node"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodeTypeYes
positionNo
assetPathYes
expectedContentHashYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.7

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so: fail-closed concurrency via expectedContentHash, deterministic auto-placement on a 24-pixel non-overlapping grid, rejection of dirty editor state, and rollback of the original asset if Unity import or shader compilation fails. The rollback and editor-lock details are exactly the mutation risks an agent needs and cannot get from the schema.

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 sentences, front-loaded with the action, then the concurrency contract, then placement and failure semantics — no filler. 'Through GraphData' is mild internal jargon, but it costs little and frames the mechanism.

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 4-parameter mutation with no annotations and no output schema, the description covers preconditions, side effects, and failure handling well. The remaining gap is the return value: an agent is not told whether it receives an updated content hash for subsequent chained edits, which matters given how heavily the fail-closed contract depends on that hash.

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 description coverage is 0%, so the description must supply parameter meaning, and it explains the two non-obvious ones: expectedContentHash must be sourced from inspect_shader_graph for stale-edit protection, and position is optional with a defined fallback layout. nodeType is only obliquely characterized ('one concrete AbstractMaterialNode') and assetPath is left to its regex pattern, so a little meaning is still missing.

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 first sentence gives a specific verb and resource: add one concrete AbstractMaterialNode to an existing Shader Graph via GraphData. That is unambiguous against siblings such as create_shader_graph or connect_shader_graph_nodes, and the singular 'one concrete ... node' sets scope an agent could not infer from the name alone.

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?

The description gives a concrete precondition chain: obtain contentHash from inspect_shader_graph and pass it as expectedContentHash. It also states a hard exclusion (open Shader Graph editor assets are rejected) and the default behavior when position is omitted. It does not name alternative tools for cases this one refuses, so it stops short of a full when/when-not map.

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