Behavior Trees
Validate, convert (behavior3 JSON, BehaviorTree.CPP XML) and open behavior trees in a visual editor
사용해야 할까요
품질 및 안전성
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"behaviortrees": {
"command": "npx",
"args": [
"behaviortrees"
]
}
}
}실행 가능한 패키지
0.2.0stdio원격 엔드포인트
https://www.behaviortrees.com/mcpstreamable-http할 수 있는 일
도구 목록
도구 (6)
🟢validate_tree(tree)
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.
입력 스키마
{
"type": "object",
"properties": {
"tree": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
],
"description": "The 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."
}
},
"required": [
"tree"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢create_editor_link(tree)
Returns a url that opens the tree in the behaviortrees.com editor in the user's browser, auto-laid-out and editable, with no account needed. The tree travels inside the link (the URL fragment), so nothing is uploaded or stored. Fails with the validation errors if the tree has any.
입력 스키마
{
"type": "object",
"properties": {
"tree": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
],
"description": "The 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."
}
},
"required": [
"tree"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢convert_tree(tree, to)
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).
입력 스키마
{
"type": "object",
"properties": {
"tree": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
],
"description": "The 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."
},
"to": {
"type": "string",
"enum": [
"behavior3",
"btcpp-v4",
"btcpp-v3"
],
"description": "Target format: behavior3, btcpp-v4 or btcpp-v3"
}
},
"required": [
"tree",
"to"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢list_node_types
The built-in behavior3 nodes a tree can use without declaring them: composites (Sequence, Priority = selector/fallback, MemSequence, MemPriority), decorators (Inverter, Repeater, MaxTime, ...) and leaves (Wait, Succeeder, Failer, ...), with descriptions and default properties.
입력 스키마
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢get_example(id)
Complete, working example trees (enemy patrol, cooldown-gated attacks, robot navigation with recovery, and more) to learn the format from or start with. Without an id, lists the examples; with an id, returns that tree as behavior3 JSON.
입력 스키마
{
"type": "object",
"properties": {
"id": {
"description": "Example id from the list; omit to list them",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢read_guide(slug)
Practical guides from behaviortrees.com/learn as Markdown: what behavior trees are, node types, blackboards, debugging, structuring large trees, and behavior trees in Unity, Unreal, Godot, Python and robotics (BehaviorTree.CPP, ROS 2, Nav2). Without a slug, lists the guides.
입력 스키마
{
"type": "object",
"properties": {
"slug": {
"description": "Guide slug from the list; omit to list them",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}커뮤니티
증거