Skip to main content
Glama

unity_set_object_reference

Set an object reference property on a Unity component using hierarchy path, instance ID, or asset path. Use for assigning prefabs, materials, or scene GameObjects to serialized ObjectReference fields.

Instructions

[LEGACY — prefer unity_component_set_reference] Set an object reference property on a component via the prefab system. Use unity_component_set_reference instead for richer resolution options.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoHierarchy path of the target GameObject
instanceIdNoInstance ID (alternative to path)
componentTypeNoComponent type name (optional - will search all components)
propertyNameYesName of the ObjectReference property to set
referencePathNoAsset path of the reference (for assets like prefabs, materials, textures)
referenceGameObjectNoName/path of a GameObject in the scene (for scene references)
portNoTarget Unity instance port for parallel-safe routing. Get this from unity_select_instance. When working with multiple Unity instances, ALWAYS include this parameter.
Behavior2/5

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

No annotations provided; description only marks legacy status but does not disclose behavioral traits like error behavior, side effects, or auth needs. Lacks detail on what happens when property is set.

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 sentences, front-loaded with legacy warning and preferred alternative. Efficient but could be slightly more structured.

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?

Given 7 parameters, no output schema, and no annotations, the description is minimal. It provides the essential deprecation info but lacks detail on return values or behavior when params conflict.

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 100% and description adds clarity by explaining referencePath for assets and referenceGameObject for scene references, complementing schema.

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?

Description states it sets object reference properties via prefab system, and explicitly identifies itself as legacy. Clearly distinguishes from sibling unity_component_set_reference.

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?

Explicitly states this tool is legacy and directs to use unity_component_set_reference instead, providing a clear when-not-to-use rule.

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/AnkleBreaker-Studio/unity-mcp-server'

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