Skip to main content
Glama

Behavior Trees

Convert a behavior tree

convert_tree
Read-onlyIdempotent

Convert between behavior3 JSON and BehaviorTree.CPP XML (v4 for ROS 2 Jazzy and Groot2, v3 for ROS 2 Humble), the same way the editor imports and exports. Returns the converted text and any issues (BT.CPP has no equivalent for some behavior3 nodes and vice versa).

Input Schema

NameRequiredDescriptionDefault
toYesTarget format: behavior3, btcpp-v4 or btcpp-v3
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.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds genuine value beyond that: it discloses the return payload (converted text plus issues) and warns that conversion is lossy in both directions because some nodes have no equivalent. It does not describe failure behavior for malformed input, which keeps it below a 5.

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?

The core capability is front-loaded in the opening clause and the second sentence covers the return contract without padding. The nested parenthetical about ROS versions makes the first sentence dense and slightly harder to scan, but no sentence is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter, side-effect-free conversion tool with no output schema, the description covers input formats, target versions, return content, and lossy-conversion caveats. Combined with the exhaustive tree parameter documentation in the schema, an agent has everything needed to call it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the enum alone lacks by explaining what btcpp-v4 and btcpp-v3 correspond to in the ROS 2 ecosystem. It also reinforces that non-built-in node names must be declared in custom_nodes, a constraint that trips up naive callers.

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 states a specific verb and two concrete resources ("Convert between behavior3 JSON and BehaviorTree.CPP XML") plus the version targets, so an agent can immediately tell this is a format translator rather than a validator or node-lister. Referencing "the same way the editor imports and exports" pins down semantics no sibling offers.

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?

It gives clear selection context by mapping btcpp-v4 to ROS 2 Jazzy/Groot2 and btcpp-v3 to Humble, which is exactly the decision an agent faces when picking a target. It also routes to list_node_types for the built-in node list, but it never states when to prefer validate_tree or create_editor_link over this tool.

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.