unity-mcp/MCPForUnity/Editor/Tools
dsarno 2b23af45a2
Fix/script path assets prefix and ctx warn bug (#453)
* Fix script path handling and FastMCP Context API usage

1. Fix script path doubling when Assets prefix is used
   - ManageScript.TryResolveUnderAssets now properly handles both Assets and Assets/ prefixes
   - Previously, paths like Assets/Script.cs would create files at Assets/Assets/Script.cs
   - Now correctly strips the prefix and creates files at the intended location

2. Fix FastMCP Context API call in manage_asset
   - Changed ctx.warn() to ctx.warning() to match FastMCP Context API
   - Fixes AttributeError when manage_asset encounters property parse errors
   - Affects ScriptableObject creation and other asset operations with invalid properties

* Fix manage_asset error handling to use ctx.error

Changed ctx.warning to ctx.error for property parse errors in manage_asset
tool to properly handle error cases. This ensures parse errors are reported
as errors rather than warnings, and fixes compatibility with FastMCP Context API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 20:09:16 -08:00
..
Prefabs [FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414) 2025-12-07 19:38:32 -05:00
BatchExecute.cs [FEATURE] Batch Commands (#418) 2025-12-07 19:36:44 -05:00
BatchExecute.cs.meta [FEATURE] Batch Commands (#418) 2025-12-07 19:36:44 -05:00
CommandRegistry.cs [FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414) 2025-12-07 19:38:32 -05: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
JsonUtil.cs Harden MCP tool parameter handling + add material workflow tests (TDD) (#343) 2025-10-23 17:57:27 -07: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 feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageAsset.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageEditor.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
ManageEditor.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageGameObject.cs feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageGameObject.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageMaterial.cs feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageMaterial.cs.meta feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageScene.cs [FEATURE] Camera Capture (#449) 2025-12-09 19:00:30 -05:00
ManageScene.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScript.cs Fix/script path assets prefix and ctx warn bug (#453) 2025-12-10 20:09:16 -08:00
ManageScript.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageShader.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
ManageShader.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04: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 Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
ReadConsole.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
RunTests.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
RunTests.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00