Skip to main content
Glama

add_component

Adds a component such as Rigidbody, AudioSource, or a custom script class to a target GameObject in Unity.

Instructions

Add a component, e.g. Rigidbody, AudioSource or your own script class name.

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": {
      "target": "<target>",
      "component": "<component>"
    },
    "name": "add_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYes
componentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world mutation, so the safety profile is covered. The description adds real value by revealing that the component argument accepts a custom script class name, not just built-in types. It omits behavior that matters for a mutation though: what happens on duplicate components, whether the change is undoable, and whether the editor must be in edit mode.

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?

One short, front-loaded sentence with no filler; the examples earn their place by defining the argument domain. Brevity here is appropriate rather than under-specified, though a single added clause on "target" would have cost nothing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Two required parameters, zero schema documentation, and no output schema, so the description must explain inputs and the return effect itself. It leaves the target parameter and the result (e.g. whether the created component handle is returned) entirely undefined, which is not sufficient for a mutation tool of this shape.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the burden for both parameters. It partially compensates for "component" via type examples, but "target" is never explained — the agent cannot tell whether it expects an object name, path, instance ID, or handle. That is a significant gap for a required parameter.

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 ("Add a component") and disambiguates the resource with concrete examples (Rigidbody, AudioSource, custom script class name). It implicitly contrasts with the sibling remove_component, but never says so explicitly, so it stops short of full sibling differentiation.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus alternatives such as create_object, set_property, or create_prefab, and no preconditions (e.g. does the target object need to exist, must play mode be off?). The examples clarify what a component is, but not when this tool is the right call.

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