Skip to content
ClaudeUnreal
GitHub

AI Systems

19 tools — 0 typed MCP · 19 via cu CLI.

  • AI — Behavior Tree & Blackboard — 9 tools
  • AI — AI Controller — 3 tools
  • AI — Navigation — 4 tools
  • AI — EQS — 3 tools

Create a Behavior Tree asset with an optional linked Blackboard for AI decision-making.

@mcp.tool()
@showcase(
"Create a Behavior Tree asset with an optional linked Blackboard for AI decision-making.",
featured=True,
)
def create_behavior_tree(
ctx: Context,
name: str,
path: str = None,
blackboard_name: str = None,
) -> ToolResult:
"""[BT] Create a new Behavior Tree asset.
Anti-patterns:
- Do not pass ``blackboard_name`` for a Blackboard that does not exist —
handler logs a warning and creates the BT without a blackboard, leaving
decorators that reference keys broken. Call ``create_blackboard`` first.
- Do not reference blackboard keys in decorators before the keys are added
via ``add_blackboard_key``.
Args:
ctx: MCP context
name: Name for the Behavior Tree asset (e.g. "BT_EnemyAI")
path: Asset path (default "/Game/AI")
blackboard_name: Optional Blackboard asset to associate (name or full path)
Returns:
Dict with name, path, root_node_id
Examples:
create_behavior_tree(name="BT_EnemyAI")
create_behavior_tree(name="BT_PatrolGuard", blackboard_name="BB_EnemyAI")
"""
from claude_unreal_server import get_unreal_connection
try:
unreal = get_unreal_connection()
if not unreal:
return err("Failed to connect to Unreal Engine")
params = {"name": name}
if path is not None:
params["path"] = path
if blackboard_name is not None:
params["blackboard_name"] = blackboard_name
response = unreal.send_command("create_behavior_tree", params)
if not response:
return err("Create Behavior Tree: no response from Unreal Engine")
if response.get("status") == "error":
return err("Create Behavior Tree failed", error=response.get("error", "Unknown error"))
result = response.get("result", response)
return ok(f"Created Behavior Tree '{name}'", **result)
except Exception as e:
logger.error(f"Error in create_behavior_tree: {e}")
return err("Create Behavior Tree failed", error=str(e))