Skip to main content
Glama

set_object_reference

Assign a serialized reference field on a Unity component to link a GameObject, Transform, or Component, wiring scene objects correctly; the field type is auto-detected.

Instructions

Set an object reference field on a component (e.g., assign a Transform to a serialized field). Use this to wire up references between GameObjects in the scene. The field type is auto-detected (Transform, GameObject, or specific Component). Requires BanterMCPBridge extension.

Input Schema

NameRequiredDescriptionDefault
objectIdNoPreferred: source GameObject globalObjectId from scene-hierarchy.json
targetIdNoPreferred: target GameObject globalObjectId from scene-hierarchy.json
objectPathNoLegacy path selector for the GameObject containing the component
targetPathNoLegacy target path selector, or 'null' to clear
componentIdNoPreferred when duplicate component types exist: source component globalObjectId
propertyNameYesSerialized field name (e.g., 'headTarget', 'cameraRig')
componentTypeNoComponent type name (e.g., 'VRPlayerController', 'PhysicsRig')
targetComponentNoOptional: specific component type on the target (e.g., 'Rigidbody'). If omitted, auto-detects based on field type.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.7

TDQS

B3.4/5.0
Behavior3/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 two useful behaviors: field type is auto-detected, and a BanterMCPBridge extension is required (an installation prerequisite). It omits mutation-relevant context such as whether this works in edit vs play mode, undo/reversibility, and what happens if the field type mismatches.

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?

Four short sentences, front-loaded with the core action, then usage, then behavior, then prerequisite. No filler, though the last line could arguably be merged or promoted since a missing bridge makes the tool fail outright.

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?

This is a complex tool (8 parameters, 8 anyOf combinations, no output schema), and the description covers purpose, the prerequisite, and auto-detection but not the selector strategy or failure behavior. Adequate to attempt a call, not sufficient to call it confidently in edge cases like duplicate component types or clearing a reference.

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 baseline is 3. The description adds one genuinely useful semantic point — that the target field type is auto-detected (Transform, GameObject, or Component) — which explains the optional targetComponent parameter, but it says nothing about the objectId-vs-objectPath or componentId-vs-componentType selection strategy encoded in the anyOf.

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 ("Set an object reference field on a component") and grounds it with a concrete example (assign a Transform to a serialized field). It implicitly separates itself from set_asset_reference and set_component_property by scoping to scene-object references, but never names those siblings to make the distinction explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use this to wire up references between GameObjects in the scene" gives a positive use context, but there is no when-not guidance and no comparison to the adjacent tools (set_component_property for plain values, set_asset_reference for asset fields). The agent must infer the boundary from the tool name alone.

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