Skip to main content
Glama

Behavior Trees

Validate a behavior tree

validate_tree
Read-onlyIdempotent

Checks a behavior tree for errors: missing or dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children, unknown node names, and BehaviorTree.CPP import problems. Returns valid (true when there are no errors), the trees found, and findings at error, warning or info level.

Input Schema

NameRequiredDescriptionDefault
treeYesThe tree: behavior3 JSON: {"title": "...", "root": "<id of the first node under the root>", "nodes": {"<id>": {"name": "<node type>", "title": "<optional label>", "children": ["<id>", ...] (composites, in run order) or "child": "<id>" (decorators), "properties": {...}}}, "custom_nodes": [{"name": "IsEnemyVisible", "category": "condition"}]}. Positions ("display") are optional. Any node name that isn't built in (see list_node_types) must be declared in custom_nodes with a category of action, condition, composite or decorator. A whole project ({"trees": [...], "custom_nodes": [...]}) or BehaviorTree.CPP XML also works.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, and non-destructive behavior, so the bar is lower; the description still adds real value by naming every validation rule applied and stating what the response contains (valid flag, trees found, findings at error/warning/info). It stops short of saying the tree is never mutated or how findings are ordered, but the check inventory is unusually concrete.

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?

Two sentences, front-loaded with the validation scope and followed by the return shape. The error enumeration is dense but every item is a distinct check that earns its place.

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?

With no output schema, the description compensates by naming the three return components, which is what an agent needs to interpret results. Combined with the fully documented input schema and read-only annotations, only minor gaps remain, such as whether it repairs anything or how findings map to specific nodes.

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% and the single `tree` parameter already carries an extensive description covering behavior3 JSON, whole projects, and BehaviorTree.CPP XML. The tool description adds nothing about the parameter, so the baseline of 3 is correct.

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 verb and resource ("Checks a behavior tree for errors") and then enumerates the exact error classes it detects: dangling children, multi-parent nodes, cycles, arity violations, unknown node names, and BehaviorTree.CPP import problems. That specificity clearly separates it from siblings like convert_tree or list_node_types.

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?

The intent is implied clearly enough that an agent would call it before converting or rendering a tree, but there is no explicit when-to-use or when-not guidance and no mention of alternatives. It does not, for example, tell the agent to call list_node_types first to learn built-in names, even though the error list includes unknown node names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.