editor.statetree

Six read-only methods for inspecting State Tree assets: the asset summary, the full states hierarchy, configurable parameters, the schema and context data requirements, registered extensions, and project-wide asset enumeration. AI agents reach through these methods to reason about AI behavior graphs without opening the State Tree editor.

← API Reference

Requires: the StateTreeModule runtime module must be loaded. Stock UE ships it enabled. If State Tree is not available, all methods return -32001 NotFound with guidance to enable the StateTree plugin.

Method summary

Method Mutating Tier Purpose
getInfonoFreeTop-level asset summary: state/node counts, ready-to-run flag, schema class.
getStatesnoFreeFull state hierarchy with depth, task/transition/condition counts.
getParametersnoFreeConfigurable parameters exposed on the asset.
getSchemanoFreeSchema class + required context data structs.
getExtensionsnoFreeExtensions registered on the State Tree.
listAssetsnoFreeProject-wide asset enumeration, optional path filter.

editor.statetree.getInfo

Returns basic information about a State Tree asset: state count, node count, ready-to-run flag, and schema class.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesFull UObject path to the State Tree asset.

Returns:

FieldTypeDescription
asset_namestringAsset name.
asset_pathstringEcho of the input path.
num_statesnumberNumber of states.
num_nodesnumberNumber of nodes.
is_ready_to_runboolWhether the asset compiled successfully and is runnable.
num_extensionsnumberNumber of registered extensions.
num_external_datanumberExternal data requirements.
schema_classstringSchema class name.
num_parametersnumberNumber of parameters.

Example Request:

{
  "jsonrpc": "2.0", "id": 1,
  "method": "editor.statetree.getInfo",
  "params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
}

Example Response:

{
  "jsonrpc": "2.0", "id": 1,
  "result": {
    "asset_name":       "ST_EnemyBehavior",
    "asset_path":       "/Game/AI/ST_EnemyBehavior.ST_EnemyBehavior",
    "num_states":       14,
    "num_nodes":        38,
    "is_ready_to_run":  true,
    "num_extensions":   2,
    "num_external_data": 1,
    "schema_class":     "StateTreeAIComponentSchema",
    "num_parameters":   4
  }
}

editor.statetree.getStates

Returns every state in the State Tree hierarchy with its depth and per-state task, transition, and enter-condition counts. The parent_index field threads the array into a tree; root states carry has_parent: false.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesFull UObject path to the State Tree asset.

Returns:

FieldTypeDescription
statesarrayEach: {index, name, depth, num_tasks, num_transitions, num_enter_conditions, has_parent, parent_index}.
countnumberNumber of states.

Example Request:

{
  "jsonrpc": "2.0", "id": 2,
  "method": "editor.statetree.getStates",
  "params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
}

Example Response:

{
  "jsonrpc": "2.0", "id": 2,
  "result": {
    "states": [
      { "index": 0, "name": "Root",     "depth": 0, "num_tasks": 0, "num_transitions": 0, "num_enter_conditions": 0, "has_parent": false, "parent_index": -1 },
      { "index": 1, "name": "Patrol",   "depth": 1, "num_tasks": 2, "num_transitions": 1, "num_enter_conditions": 0, "has_parent": true,  "parent_index": 0  },
      { "index": 2, "name": "Chase",    "depth": 1, "num_tasks": 1, "num_transitions": 2, "num_enter_conditions": 1, "has_parent": true,  "parent_index": 0  }
    ],
    "count": 3
  }
}

editor.statetree.getParameters

Returns the State Tree's configurable parameters -- the public input surface callers pass in when instancing the tree.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesFull UObject path.

Returns:

FieldTypeDescription
parametersarrayEach: {name, type, type_object}.
countnumberNumber of parameters.

Example Request:

{
  "jsonrpc": "2.0", "id": 3,
  "method": "editor.statetree.getParameters",
  "params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
}

Example Response:

{
  "jsonrpc": "2.0", "id": 3,
  "result": {
    "parameters": [
      { "name": "AggroRange",    "type": "float",   "type_object": "" },
      { "name": "PatrolPath",    "type": "object",  "type_object": "/Script/Engine.SplineComponent" }
    ],
    "count": 2
  }
}

editor.statetree.getSchema

Returns the State Tree schema and its required context data. The schema constrains which evaluators and tasks the tree can host; the context data list is the runtime inputs a caller must provide.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesFull UObject path.

Returns:

FieldTypeDescription
schema_classstringSchema class name (e.g. StateTreeAIComponentSchema).
schema_pathstringFull path to the schema class.
context_dataarrayEach: {name, struct_type}.
num_context_datanumberContext data count.

Example Request:

{
  "jsonrpc": "2.0", "id": 4,
  "method": "editor.statetree.getSchema",
  "params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
}

Example Response:

{
  "jsonrpc": "2.0", "id": 4,
  "result": {
    "schema_class":   "StateTreeAIComponentSchema",
    "schema_path":    "/Script/StateTreeModule.StateTreeAIComponentSchema",
    "context_data":   [ { "name": "Actor", "struct_type": "/Script/Engine.Actor" } ],
    "num_context_data": 1
  }
}

editor.statetree.getExtensions

Returns extensions registered on the State Tree -- subsystems or components the tree hooks into at runtime.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesFull UObject path.

Returns:

FieldTypeDescription
extensionsarrayEach: {class, name}.
countnumberNumber of extensions.

Example Request:

{
  "jsonrpc": "2.0", "id": 5,
  "method": "editor.statetree.getExtensions",
  "params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
}

Example Response:

{
  "jsonrpc": "2.0", "id": 5,
  "result": {
    "extensions": [
      { "class": "StateTreeAIExtension",  "name": "AI"  }
    ],
    "count": 1
  }
}

editor.statetree.listAssets

Lists all State Tree assets in the project. Accepts an optional substring filter on the package path.

Parameters:

NameTypeRequiredDescription
path_filterstringNoReturn only assets whose path contains this substring.

Returns:

FieldTypeDescription
assetsarrayEach: {name, path}.
countnumberNumber of State Tree assets returned.

Example Request:

{ "jsonrpc": "2.0", "id": 6, "method": "editor.statetree.listAssets" }

Example Response:

{
  "jsonrpc": "2.0", "id": 6,
  "result": {
    "assets": [
      { "name": "ST_EnemyBehavior", "path": "/Game/AI/ST_EnemyBehavior.ST_EnemyBehavior" },
      { "name": "ST_NPCGreeter",    "path": "/Game/AI/ST_NPCGreeter.ST_NPCGreeter"     }
    ],
    "count": 2
  }
}

Related