Skip to main content
Glama

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).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tree": "<tree>",
      "to": "<to>"
    },
    "name": "convert_tree"
  }
}

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. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's job is added context, which it delivers: it states returns (converted text plus issues) and warns that conversion is lossy because BT.CPP lacks equivalents for some behavior3 nodes and vice versa. It does not clarify whether lossy mapping surfaces as an error or a warning-only result, which is the remaining ambiguity.

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?

Two sentences, front-loaded with the conversion direction, and every clause carries information (versions, editor parity, lossiness). The nested parentheticals around ROS distributions make the first sentence dense, but nothing is wasted and trimming would lose the version mapping.

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?

With no output schema, the description takes on return-value disclosure and does so ("Returns the converted text and any issues"). Combined with the lossiness note and the rich schema, an agent has everything needed to select and invoke this two-parameter tool 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 description coverage is already 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the target-format enum values are tied to concrete runtime contexts (Jazzy/Groot2 vs Humble) and the accepted input surface is broadened (whole project object or existing BT.CPP XML). That contextual mapping is genuinely useful for choosing the right `to` value.

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?

States a specific verb+resource ("Convert between behavior3 JSON and BehaviorTree.CPP XML") and pins the direction and target versions (v4 for Jazzy/Groot2, v3 for Humble). An agent can immediately tell this apart from validate_tree or list_node_types without opening the schema.

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 format enumeration and by the schema's pointer to list_node_types for undeclared node names, but the description never says when to convert versus when to validate (validate_tree) or fetch an example (get_example). No explicit when-not-to-use or prerequisite guidance is given.

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.