Skip to main content
Glama

editor_add_script

Attach a script type to a Flax actor by ID and optionally set its order; in edit mode it marks the scene edited so editor_save persists the change.

Instructions

Adds a script of a type to an actor (nothing when it has one already) and, in edit mode, marks the scene edited so editor_save keeps it. The type is resolved by full or short name in the loaded assemblies.

Input Schema

NameRequiredDescriptionDefault
actorIdYesThe actor's id.
scriptTypeYesThe script type, e.g. Game.Testing.TestDriver.
orderInParentNoThe script's place among the actor's scripts.

Output Schema

NameRequiredDescriptionDefault
addedYes
actorIdYes
scriptsYes
scriptIdYes
scriptTypeYes
mainThreadIdYes
orderInParentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden and does well: it discloses idempotency ('no-op if already present'), the dirty-scene side effect that makes editor_save persist the change, and that componentType is fuzzy-resolved against the type registry. What it omits is whether the operation is undoable or what the failure mode looks like when the type resolves ambiguously, keeping it at 4 rather than 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the verb and resource, then the caveat and side effect. Zero filler and nothing buried.

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?

With an output schema present, the description need not explain return values, and it covers the two non-obvious behaviors (no-op semantics, dirty-scene marking) plus type resolution. It could say more about execution context requirements (e.g., whether a scene must be open), but it is close to complete for a 3-parameter tool.

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 coverage is 100%, so baseline is 3, but the description adds real semantics the schema lacks: componentType accepts short names resolved by fuzzy match, not just exact type strings as the schema's example implies. orderInParent is left to the schema, which fully documents it.

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 description says exactly what the tool does: 'Adds a script-type component to an actor', with the idempotency caveat and the edit-mode side effect. An agent can immediately distinguish it from editor_remove_component or editor_set_component_property.

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?

It gives an explicit routing rule: use this to add a component, but use editor_set_component_property instead when the goal is to change properties on an existing component. The named alternative actually exists among the siblings, so the guidance is actionable rather than decorative.

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