unity-mcp/MCPForUnity/Editor/Tools
dsarno 62c015d873
Add create_child parameter to manage_prefabs modify_contents (#646)
* Add create_child parameter to manage_prefabs modify_contents

Enables adding child GameObjects to existing prefabs via headless editing.
Supports single object or array for batch creation in one save operation.

Features:
- Create children with primitive types (Cube, Sphere, etc.)
- Set position, rotation, scale on new children
- Add components to children
- Specify parent within prefab hierarchy for nested children
- Set tag, layer, and active state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Address code review feedback for create_child validation

- Fix type hint to `tuple[dict | None, str | None]` to match actual returns
- Add explicit dict validation with clear error message including actual type
- Error on invalid component entries instead of silently ignoring them
- Return ErrorResponse for invalid tag/layer instead of just logging warnings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add unit tests for create_child prefab functionality

Tests cover:
- Single child with primitive type
- Empty GameObject (no primitive_type)
- Multiple children from array (batch creation)
- Nested parenting within prefab
- Error handling for invalid inputs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 04:14:52 -08:00
..
GameObjects Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
Prefabs Add create_child parameter to manage_prefabs modify_contents (#646) 2026-01-29 04:14:52 -08:00
Vfx Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
BatchExecute.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
BatchExecute.cs.meta [FEATURE] Batch Commands (#418) 2025-12-07 19:36:44 -05:00
CommandRegistry.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
CommandRegistry.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ExecuteMenuItem.cs [FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414) 2025-12-07 19:38:32 -05:00
ExecuteMenuItem.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
FindGameObjects.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
FindGameObjects.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
GameObjects.meta v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00
GetTestJob.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
GetTestJob.cs.meta Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
JsonUtil.cs v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00
JsonUtil.cs.meta fix: add missing JsonUtil.cs.meta file to resolve package import errors 2025-10-23 19:42:58 -07:00
ManageAsset.cs [FEATURE] Procedural Texture2D/Sprite Generation (#621) 2026-01-24 17:09:07 -05:00
ManageAsset.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageComponents.cs fix: prefab stage dirty flag, root rename, test fix, and prefab resources (#627) 2026-01-25 17:35:01 -08:00
ManageComponents.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
ManageEditor.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ManageEditor.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageMaterial.cs [FEATURE] Procedural Texture2D/Sprite Generation (#621) 2026-01-24 17:09:07 -05:00
ManageMaterial.cs.meta feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageScene.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ManageScene.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScript.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ManageScript.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScriptableObject.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ManageScriptableObject.cs.meta feature/Add new manage_scriptable_object tool (#489) 2025-12-28 20:15:50 -08:00
ManageShader.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ManageShader.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageTexture.cs [FEATURE] Procedural Texture2D/Sprite Generation (#621) 2026-01-24 17:09:07 -05:00
ManageTexture.cs.meta [FEATURE] Procedural Texture2D/Sprite Generation (#621) 2026-01-24 17:09:07 -05:00
McpForUnityToolAttribute.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpForUnityToolAttribute.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Prefabs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ReadConsole.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
ReadConsole.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
RefreshUnity.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
RefreshUnity.cs.meta Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
RunTests.cs Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
RunTests.cs.meta v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00
Vfx.meta v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00