Skip to main content
Glama

build_behavior_tree

Construct a complete Unreal Engine Behavior Tree graph from a JSON description, including nodes, links, decorators, and services, in one call.

Instructions

Build an entire Behavior Tree graph from a JSON description in one call.

This is the primary tool for creating BT logic. Pass the full tree as a nested JSON object and the C++ plugin will build every node, link pins, attach decorators/services, and save the asset.

Node type strings (case-insensitive): Composites : "Selector", "Sequence" Tasks : "Wait", "MoveTo" Custom : full class name e.g. "BTTask_MyCustomTask" or Blueprint path

Tree format: { "type": "Selector", "children": [ { "type": "Sequence", "decorators": [{"type": "BTDecorator_Blackboard", "properties": {...}}], "services": [{"type": "BTService_DefaultFocus"}], "children": [ {"type": "MoveTo", "properties": {"AcceptableRadius": "50.0"}}, {"type": "Wait", "properties": {"WaitTime": "2.0"}} ] } ] }

Args: behavior_tree_name: Name of an EXISTING BT asset (create_behavior_tree first) tree: Root node JSON object (see format above) clear_existing: If True (default), remove all non-root nodes first

Returns: Dict with 'success', 'behavior_tree', 'nodes_created', 'nodes' list

KB: see knowledge_base/04_AI_SYSTEMS.md#overview Example: build_behavior_tree(behavior_tree_name="ExampleName", tree=[])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
treeYes
clear_existingNo
behavior_tree_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full disclosure burden and handles it well. It states the C++ plugin will build every node, link pins, attach decorators/services, and save the asset, and it explicitly warns that clear_existing (default True) removes all non-root nodes first. It also documents the return dict. These are the key behavioral and side-effect details an agent needs.

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?

The description is front-loaded with purpose and then organized into node types, tree format, arguments, returns, KB reference, and example. It is longer than average, but the tool's open JSON input justifies the detail. The empty-array example conflicts with the documented object format, which slightly hurts the otherwise clean structure.

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?

Given an open-object tree parameter, nested objects, zero parameter descriptions, and no annotations, the description provides a strong schema substitute: supported node types, decorator and service placement, a concrete tree example, the prerequisite create_behavior_tree step, and clear_existing semantics. It is nearly complete, though it does not fully specify the valid type/property conventions for decorators and services beyond the two examples.

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 0%, so the description must define the parameters itself. It does: behavior_tree_name is an EXISTING asset, tree is a nested root-node JSON object with a detailed format, and clear_existing has a default and destructive semantics. The included node-type taxonomy and tree format example add significant meaning beyond the bare schema. The only blemish is the example showing tree=[] even though tree is documented as a root JSON object.

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 opens with a specific operation: 'Build an entire Behavior Tree graph from a JSON description in one call.' It identifies the resource (Behavior Tree graph) and the delivery mechanism (nested JSON object) precisely. Naming it 'the primary tool for creating BT logic' also separates it from sibling tools such as add_bt_node, create_blackboard, and repair_behavior_tree.

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?

The description clearly states this is the primary whole-tree creation tool and explicitly tells the agent that behavior_tree_name must be an existing BT asset created by create_behavior_tree first. It also documents clear_existing's default destructive behavior. It does not explicitly enumerate when to prefer add_bt_node or repair_behavior_tree instead, so it stops just short of a full when-not/alternatives statement.

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