Skip to main content
Glama

unity_set_material

Set a shader property on an object's material or a material asset; by default, copy the material so shared objects stay unchanged.

Instructions

Set a shader property (color/float/vector) on the material of an object, or on a material asset. By default the renderer gets its own copy so other objects sharing the material are untouched. (Unity editor offline right now: schemas are cached; calls will fail until it reconnects)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "unity_set_material"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoinstance (default) copies the material for this object only; shared edits the material asset itself and affects every user of it
pathNoGameObject path (material is taken from its Renderer)
typeNoforce the value kind
valueNonumber, #hex, [r,g,b,a] or [x,y,z]
materialNooptional material asset path or builtin name like Default-Material, overrides path
propertyNoshader property, e.g. color or _BaseColor

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the most important behavioral trait: the default copy-on-write semantics mean other objects sharing the material are untouched. It also flags an environment-level failure mode (offline editor, cached schemas, calls will fail). It omits error behavior when a property name is invalid and whether the operation is undoable.

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?

Two tight sentences, front-loaded with the core action and followed by the default-copy consequence. The trailing parenthetical about the offline editor is operationally useful but transient, so it slightly dilutes an otherwise efficient statement.

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 6-parameter, zero-required mutation tool with no output schema and no annotations, the description covers the source of the material, the default copy behavior, and the current connectivity caveat. The main remaining gap is what a call returns or how property-name failures surface.

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 description coverage is 100%, so the schema already documents path, material, property, type, value and the instance/shared mode. The description adds only a partial restatement ('color/float/vector'), and notably omits 'int', which the type enum includes, so it adds little beyond the schema and slightly narrows the supported kinds.

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?

The description states a specific verb and resource: set a shader property (color/float/vector) on either an object's material or a material asset. That is concrete enough to act on, but it never distinguishes itself from the sibling unity_set_property, which an agent could plausibly confuse it with for generic component writes.

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 gives clear operational context: by default the renderer gets its own copy, and the schema notes shared mode affects every user of the material, which is the key decision an agent must make. It does not name any alternative tool or state explicit exclusions, so it falls short of full when/when-not guidance.

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