{"record":{"id":"bce47df8bbaf7d03","repo":"CoplayDev/unity-mcp","slug":"unknown-shape-type-shapetypestr-valid-types","errorCode":null,"errorMessage":"Unknown shape type '{shapeTypeStr}'. Valid types: {validTypes}","messagePattern":"Unknown shape type '(.+?)'\\. Valid types: (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Tools/ProBuilder/ManageProBuilder.cs","lineNumber":820,"sourceCode":"                        new object[] { pivot, totalWidth, totalHeight, ledgeHeight, legWidth, d });\n                }\n\n                default:\n                    return null;\n            }\n        }\n\n        private static Component CreateShapeGeneric(string shapeTypeStr)\n        {\n            object shapeTypeValue;\n            try\n            {\n                shapeTypeValue = Enum.Parse(_shapeTypeEnum, shapeTypeStr, true);\n            }\n            catch\n            {\n                var validTypes = string.Join(\", \", Enum.GetNames(_shapeTypeEnum));\n                throw new Exception($\"Unknown shape type '{shapeTypeStr}'. Valid types: {validTypes}\");\n            }\n\n            // Try CreateShape(ShapeType) first\n            var createMethod = _shapeGeneratorType.GetMethod(\"CreateShape\",\n                BindingFlags.Static | BindingFlags.Public,\n                null,\n                new[] { _shapeTypeEnum },\n                null);\n\n            object[] invokeArgs;\n            if (createMethod != null)\n            {\n                invokeArgs = new[] { shapeTypeValue };\n            }\n            else if (_pivotLocationType != null)\n            {\n                createMethod = _shapeGeneratorType.GetMethod(\"CreateShape\",\n                    BindingFlags.Static | BindingFlags.Public,","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Tools/ProBuilder/ManageProBuilder.cs#L802-L838","documentation":"Thrown by CreateShapeGeneric when the 'shapeType' string cannot be parsed against the ProBuilder ShapeType enum (Unity.ProBuilder.ShapeType) via Enum.Parse with case-insensitive matching. Valid types include: Cube, Cylinder, Sphere, Plane, Cone, Torus, Pipe, Arch, Stair, CurvedStair, Door, Prism.","triggerScenarios":"Calling create_shape with a shapeType value not in the ShapeType enum. Typo, wrong casing that still fails (though matching is case-insensitive), or using a non-ProBuilder shape name like 'Box', 'Capsule', or 'Quad'.","commonSituations":"AI uses standard Unity primitive names (Box, Capsule) instead of ProBuilder names; different ProBuilder version exposes a different enum set; typo or trailing whitespace in the shape type.","solutions":["Use one of the valid ShapeType names: Cube, Cylinder, Sphere, Plane, Cone, Torus, Pipe, Arch, Stair, CurvedStair, Door, Prism.","If you need a standard primitive, use manage_gameobject create with a primitive type instead.","Strip whitespace from the shapeType value before sending.","If a shape type from documentation is rejected, verify your ProBuilder package version supports that enum value."],"exampleFix":"// before\nparams = {\"action\": \"create\", \"shapeType\": \"Box\"}\n// after\nparams = {\"action\": \"create\", \"shapeType\": \"Cube\"}","handlingStrategy":"validation","validationCode":"VALID_SHAPE_TYPES = {\n    'Cube', 'Cylinder', 'Sphere', 'Plane', 'Cone', 'Torus',\n    'Pipe', 'Arch', 'Stair', 'CurvedStair', 'Door', 'Prism'\n}\n\ndef validate_shape_type(shape_type: str) -> bool:\n    return shape_type in VALID_SHAPE_TYPES","typeGuard":null,"tryCatchPattern":"try\n{\n    var shape = CreateShapeGeneric(shapeTypeStr);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"Unknown shape type\"))\n{\n    return new ErrorResponse(ex.Message);  // message includes valid types\n}","preventionTips":["Use the exact ProBuilder ShapeType enum names, not standard Unity primitive names.","Check the tool's documentation or class header comment for the valid type list.","Case-insensitive matching is supported but the name must still be correct.","Avoid names like 'Box', 'Capsule', or 'Quad' which are Unity primitives, not ProBuilder shapes."],"tags":["probuilder","shape-type","enum","validation","create"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}