Skip to main content
Glama

add_bt_composite_child

Idempotent

Adds a child composite (Selector, Sequence, or SimpleParallel) under a BehaviorTree parent composite in Unreal Engine, appending it to the execution order for AI behavior authoring.

Instructions

Add a child composite (Selector/Sequence/SimpleParallel) under a BehaviorTree composite. The child is appended to the parent's Children (array order = execution order). Authoring is data-only: ParentNode/ExecutionIndex are assigned by the BT runtime at load (run_behavior_tree). Idempotent by child_name within the parent. The returned child_name is how you address this composite as a parent for further children.

Returns: { behavior_tree_path: string, parent_name: string, child_name: string, child_class: string, child_kind: string, already_exists: bool, child_count: int, saved: bool, save_error?: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compositeYesConcrete composite class: "Selector" | "Sequence" | "SimpleParallel" (or a BTComposite_* class name).
child_nameNoOptional stable name for the new node (its identity for idempotency/addressing); defaults to the composite type.
parent_nameNoOptional parent composite name (a child_name from a prior add); "Root" or omitted targets the RootNode.
behavior_tree_pathYesPath to the UBehaviorTree asset (its RootNode must already be set via set_behavior_tree_root).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false; the description adds real context beyond them by specifying idempotency is keyed on child_name within the parent, that authoring is data-only with ParentNode/ExecutionIndex assigned at load by run_behavior_tree, and by mapping the return payload including save_error. This is strong disclosure for a mutation tool.

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?

Front-loaded with the core action and placement rule, then behavioral notes, then the return shape. Every sentence earns its place, though the inline Returns block is somewhat long for a description.

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?

There is no output schema, and the description compensates by fully documenting the return fields (behavior_tree_path, parent_name, child_name, child_class, child_kind, already_exists, child_count, saved, save_error). Combined with the load-time/idempotency notes, an agent has what it needs to call it correctly.

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 the baseline is 3, but the description adds meaning beyond the schema: it clarifies that child_name defaults to the composite type and is the idempotency/addressing key, and that parent_name accepts 'Root' or omission to target the RootNode. These routing details go past the raw schema text.

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 (Add) and resource (child composite) and enumerates the concrete composite kinds (Selector/Sequence/SimpleParallel) plus the placement semantics (appended to parent's Children, array order = execution order). It is clearly distinguishable from add_bt_task_child, add_bt_decorator, and remove_bt_composite_child in the sibling list.

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?

Explains targeting (parent_name of 'Root' or omitted hits the RootNode), the prerequisite that behavior_tree_path's RootNode must already be set, and how the returned child_name becomes the parent for further children. It does not explicitly name alternative add_* tools, so it stops just short of the 5 bar.

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