Skip to content

Commit 61e9a7f

Browse files
authored
Merge pull request #733 from dsarno/fix/694-rebased
fix: improve tool descriptions with explicit cross-references (rebased #694)
2 parents de2902c + 85bf8c1 commit 61e9a7f

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

Server/src/services/tools/find_gameobjects.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616

1717
@mcp_for_unity_tool(
18-
description="Search for GameObjects in the scene. Requires search_term (name, tag, layer name, component type, or path). Returns instance IDs only (paginated). Use mcpforunity://scene/gameobject/{id} resource to get full GameObject data."
18+
description=(
19+
"Search for GameObjects in the scene by name, tag, layer, component type, or path. "
20+
"Returns instance IDs only (paginated). "
21+
"Then use mcpforunity://scene/gameobject/{id} resource for full data, "
22+
"or mcpforunity://scene/gameobject/{id}/components for component details. "
23+
"For CRUD operations (create/modify/delete), use manage_gameobject instead."
24+
)
1925
)
2026
async def find_gameobjects(
2127
ctx: Context,

Server/src/services/tools/manage_components.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414

1515

1616
@mcp_for_unity_tool(
17-
description="Manages components on GameObjects (add, remove, set_property). For reading component data, use the mcpforunity://scene/gameobject/{id}/components resource."
17+
description=(
18+
"Add, remove, or set properties on components attached to GameObjects. "
19+
"Actions: add, remove, set_property. Requires target (instance ID or name) and component_type. "
20+
"For READING component data, use the mcpforunity://scene/gameobject/{id}/components resource "
21+
"or mcpforunity://scene/gameobject/{id}/component/{name} for a single component. "
22+
"For creating/deleting GameObjects themselves, use manage_gameobject instead."
23+
)
1824
)
1925
async def manage_components(
2026
ctx: Context,

Server/src/services/tools/manage_gameobject.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def _normalize_component_properties(value: Any) -> tuple[dict[str, dict[str, Any
4242
description=(
4343
"Performs CRUD operations on GameObjects. "
4444
"Actions: create, modify, delete, duplicate, move_relative. "
45-
"To FIND GameObjects, use the find_gameobjects tool instead. "
46-
"To manage COMPONENTS (add/remove/set_property), use the manage_components tool instead. "
47-
"To READ component data, use the mcpforunity://scene/gameobject/{id}/components resource."
45+
"NOT for searching — use the find_gameobjects tool to search by name/tag/layer/component/path. "
46+
"NOT for component management — use the manage_components tool (add/remove/set_property) "
47+
"or mcpforunity://scene/gameobject/{id}/components resource (read)."
4848
),
4949
annotations=ToolAnnotations(
5050
title="Manage GameObject",
@@ -121,7 +121,7 @@ async def manage_gameobject(
121121
if action is None:
122122
return {
123123
"success": False,
124-
"message": "Missing required parameter 'action'. Valid actions: create, modify, delete, duplicate, move_relative. For finding GameObjects use find_gameobjects tool. For component operations use manage_components tool."
124+
"message": "Missing required parameter 'action'. Valid actions: create, modify, delete, duplicate, move_relative. To SEARCH for GameObjects use the find_gameobjects tool. To manage COMPONENTS use the manage_components tool."
125125
}
126126

127127
# --- Normalize vector parameters with detailed error handling ---

0 commit comments

Comments
 (0)