{"record":{"id":"062416ab3df1c389","repo":"googleapis/mcp-toolbox","slug":"s-path-cannot-be-empty","errorCode":null,"errorMessage":"%s path cannot be empty","messagePattern":"(.+?) path cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/util/validator.go","lineNumber":58,"sourceCode":"\treturn validatePath(path, CollectionPath)\n}\n\n// ValidateDocumentPath validates that a path is a valid Firestore document path.\n// Document paths must have an even number of segments (collection/doc or collection/doc/collection/doc)\nfunc ValidateDocumentPath(path string) error {\n\treturn validatePath(path, DocumentPath)\n}\n\n// validatePath is the common validation function for both collection and document paths\nfunc validatePath(path string, pathType PathType) error {\n\tpathTypeName := \"document\"\n\tif pathType == CollectionPath {\n\t\tpathTypeName = \"collection\"\n\t}\n\n\t// Check for empty path\n\tif path == \"\" {\n\t\treturn fmt.Errorf(\"%s path cannot be empty\", pathTypeName)\n\t}\n\n\t// Check if it's an absolute path\n\tif absolutePathRegex.MatchString(path) {\n\t\texample := \"users/userId\"\n\t\tif pathType == CollectionPath {\n\t\t\texample = \"users\"\n\t\t}\n\t\treturn fmt.Errorf(\"path must be relative (e.g., '%s'), not absolute (matching pattern: ^projects/[^/]+/databases/[^/]+/documents/)\", example)\n\t}\n\n\t// Split the path using strings.Split to preserve empty segments\n\tsegments := strings.Split(path, \"/\")\n\n\t// Check for empty result\n\tif len(segments) == 0 {\n\t\treturn fmt.Errorf(\"%s path cannot be empty or contain only slashes\", pathTypeName)\n\t}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/util/validator.go#L40-L76","documentation":"First guard in the shared Firestore path validator: the collection or document path string is empty, so there is no path to validate.","triggerScenarios":"Thrown at internal/tools/firestore/util/validator.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a non-empty relative path such as 'users' (collection) or 'users/alice' (document)","Omit the parameter only if the tool marks it optional"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}