Skip to main content
Glama

add_blueprint_variable

Adds a member variable to an Unreal Blueprint, defining its type, default, and optional array status so variable get/set nodes can read or write it.

Instructions

Add a MEMBER variable to a Blueprint (add_function_local_variable is the function-scoped twin), then read/write it with add_graph_node node_type=variable_get/variable_set. TRAP 1: the variable is born NOT editable per instance -- placing the actor and writing that variable fails with "cannot be edited on instances" -- and get_blueprint_variables reports instance_editable:true anyway; fix it with set_bp_variable_metadata(instance_editable=true). TRAP 2: on a class that ALREADY has actors placed in a level, those instances keep the value of the first compile, so a default set afterwards never reaches them -- verify on the instances, not on the CDO.

Returns: { blueprint_name, variable_name, variable_type, is_array } -- an echo of the request, NOT a verification: read the variable back with get_blueprint_variables (or the CDO) before relying on it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoOptional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk.
is_arrayNoWhen true, make the variable an array container; defaults to false. This is the ONLY array authoring path -- add_function_parameter has no equivalent.
default_valueNoInitial default value for the new variable, in exported-text form; optional
variable_nameYesNew variable name (fails if the name already exists on this Blueprint).
variable_typeYesType string: bool, int, int64, float, string, name, text, byte, or the name/path of a struct, enum, class or object (e.g. Vector, /Game/Dir/S_Foo.S_Foo, /Script/Engine.Actor).
blueprint_nameNoBlueprint name or path.
blueprint_pathNoAlias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only flag the write/non-idempotent profile; the description goes far beyond, disclosing two non-obvious failure modes (instance_editable default false with misleading get_blueprint_variables output, and placed instances retaining first-compile values), plus the PIE refusal and its safety rationale. This is exactly the behavioral context a mutation tool needs and that structured fields cannot convey.

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?

Purpose and scope are front-loaded, and the labeled TRAP 1/TRAP 2 framing makes the warnings scannable. It is dense and runs long, but nearly every sentence carries actionable information (the only borderline item is the alias remark, which is arguably useful routing context).

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

Completeness5/5

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

With no output schema, the description still explains the return payload and, crucially, warns that it is an echo rather than verification, directing the agent to read back via get_blueprint_variables. Combined with the trap coverage and PIE precondition, nothing an agent needs to invoke this correctly is missing.

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 all seven parameters thoroughly (force, is_array, default_value, variable_name/type, blueprint_name/path alias). The description adds behavioral context around force/PIE and the array path but no additional parameter syntax, so baseline 3 is appropriate.

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?

States a specific verb+resource ('Add a MEMBER variable to a Blueprint') and immediately distinguishes it from its sibling by naming the function-scoped twin add_function_local_variable. It also explains how the variable is subsequently used (add_graph_node node_type=variable_get/variable_set), so an agent can place it correctly without opening a schema.

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?

Explicitly contrasts member vs function-local scope via the named twin, and documents the PIE precondition (refused during Play-in-Editor) with force as the escape hatch. It lacks a broader statement of when a caller should prefer this over the other variable-authoring paths (e.g. add_function_parameter), but the key alternative is named.

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

Deploy Server

Other Tools