diff --git a/MCPForUnity/Editor/Tools/ManageScript.cs b/MCPForUnity/Editor/Tools/ManageScript.cs index 3745ec7..03da19d 100644 --- a/MCPForUnity/Editor/Tools/ManageScript.cs +++ b/MCPForUnity/Editor/Tools/ManageScript.cs @@ -65,7 +65,17 @@ namespace MCPForUnity.Editor.Tools // Normalize caller path: allow both "Scripts/..." and "Assets/Scripts/..." string rel = (relDir ?? "Scripts").Replace('\\', '/').Trim(); if (string.IsNullOrEmpty(rel)) rel = "Scripts"; - if (rel.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase)) rel = rel.Substring(7); + + // Handle both "Assets" and "Assets/" prefixes + if (rel.Equals("Assets", StringComparison.OrdinalIgnoreCase)) + { + rel = string.Empty; + } + else if (rel.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase)) + { + rel = rel.Substring(7); + } + rel = rel.TrimStart('/'); string targetDir = Path.Combine(assets, rel).Replace('\\', '/'); diff --git a/Server/src/services/tools/manage_asset.py b/Server/src/services/tools/manage_asset.py index c9c4b5a..e7264ea 100644 --- a/Server/src/services/tools/manage_asset.py +++ b/Server/src/services/tools/manage_asset.py @@ -80,7 +80,7 @@ async def manage_asset( properties, parse_error = await _normalize_properties(properties) if parse_error: - await ctx.warn(parse_error) + await ctx.error(parse_error) return {"success": False, "message": parse_error} # Coerce numeric inputs defensively