Commit 2b23af4
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 <[email protected]>
---------
Co-authored-by: Claude Sonnet 4.5 <[email protected]>1 parent 237b26e commit 2b23af4
File tree
2 files changed
+12
-2
lines changed- MCPForUnity/Editor/Tools
- Server/src/services/tools
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments