Skip to main content
Glama

add_bt_task_child

Idempotent

Add a leaf task such as Wait or MoveTo under a BehaviorTree composite, appending it to the parent's Children in execution order for data-only authoring.

Instructions

Add a leaf task node (Wait/MoveTo/PlaySound/RunBehavior/...) under a BehaviorTree composite. The task 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. Idempotent by child_name within the parent.

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
child_nameNoOptional stable name for the new node; defaults to the task type.
task_classYesConcrete task class: "Wait" | "MoveTo" | "PlaySound" | "RunBehavior" | "FinishWithResult" (or a BTTask_* class name).
parent_nameNoOptional parent composite name; "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.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly=false, destructive=false, idempotent=true, openWorld=false), but the description adds real depth beyond them: append/execution-order semantics, that ParentNode and ExecutionIndex are runtime-assigned so the agent should not set them, the scope of idempotency ('by child_name within the parent'), and the persisted outcome via saved/save_error. It does not discuss failure modes for a bad parent_name or whether the asset must be saved separately.

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 action, with three tight sentences of semantics followed by a Returns block. The Returns enumeration is verbose but justified because no output schema exists; nothing is truly wasted, though it could be trimmed slightly.

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?

For a mutation tool with no output schema, the description covers the mutation semantics, runtime-assigned fields, idempotency scope, and the return contract. Remaining gaps are minor: persistence/saving expectations and explicit relationship to remove_bt_task_child and add_bt_composite_child are not stated.

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 explains child_name defaults, parent_name 'Root'/omitted behavior, the accepted task_class values, and the RootNode prerequisite. The description repeats the task-type list but adds no syntax or format detail beyond the schema, 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+scope: 'Add a leaf task node ... under a BehaviorTree composite,' and enumerates the concrete task types (Wait/MoveTo/PlaySound/RunBehavior). The word 'leaf' and 'under a composite' implicitly separates it from sibling add_bt_composite_child without needing to name it.

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?

Gives clear operating context: the task is appended to the parent's Children with array order = execution order, and the prerequisite that the asset's RootNode must already be set (via set_behavior_tree_root) appears in the schema. It does not explicitly say when to prefer this over add_bt_composite_child or what to do for non-leaf nodes, so it stops short of full alternative routing.

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