Skip to main content
Glama

statetree_add_state

Insert a new state into a StateTree asset as a root subtree or child state, specifying parent, type, and save behavior.

Instructions

Add a root subtree or child state to a StateTree asset.

Args: state_tree: StateTree asset path or object path. name: State display name to add. parent_state: Optional parent state name or GUID. Empty uses the first root. description: Optional editor description for the state. state_type: "state", "group", "linked", "linked_asset", or "subtree". as_subtree: Add as a top-level subtree instead of child state. enabled: Initial enabled flag. save: Save the asset after mutation.

Returns: Structured JSON with inserted state details and state counts.

KB: see knowledge_base/23_MASS_ENTITY_AND_STATETREE.md#mcp-mass-statetree-and-smartobject-tools Example: statetree_add_state(state_tree="/Game/AI/StateTrees/ST_CombatBrain", name="Patrol", parent_state="Root")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
saveNo
enabledNo
as_subtreeNo
state_treeYes
state_typeNostate
descriptionNo
parent_stateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are supplied, so the description must carry behavioral weight. It makes the mutation explicit ('Save the asset after mutation'), explains parent selection fallback, and documents the as_subtree mode. It does not cover failure modes, reversibility, permissions, or side effects on linked/grouped states, so it is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose sentence is front-loaded, and each subsequent block (Args, Returns, KB reference, Example) contributes non-redundant information. It is detailed without filler, with the example placed last as a quick reference.

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 an 8-parameter mutation tool with no annotations, the description covers every parameter, the return shape, and a realistic example, plus a KB pointer. It is only missing explicit guidance about when to prefer this over sibling StateTree tools and what asset prerequisites must hold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the Args block compensates fully by describing all eight parameters, including the state_type enum values, parent_state GUID/empty-root behavior, and as_subtree semantics. The example call further clarifies how state_tree and parent_state are used together.

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 opening sentence states exactly what the tool does: 'Add a root subtree or child state to a StateTree asset.' It names a specific verb, resource, and the two insertion modes, which distinguishes it from sibling tools like statetree_create and statetree_inspect.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the purpose line and a concrete example call, but the description does not explicitly compare this to statetree_create or statetree_inspect, nor does it state when not to use it. Prerequisites such as an existing StateTree asset are not called out.

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