{"record":{"id":"99ed40e47e12dda4","repo":"googleapis/mcp-toolbox","slug":"segment-cannot-be-or","errorCode":null,"errorMessage":"segment cannot be '.' or '..'","messagePattern":"segment cannot be '\\.' or '\\.\\.'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/util/validator.go","lineNumber":118,"sourceCode":"func validateSegment(segment string, isCollection bool) error {\n\tsegmentType := \"document ID\"\n\tif isCollection {\n\t\tsegmentType = \"collection ID\"\n\t}\n\n\t// Check for empty segment\n\tif segment == \"\" {\n\t\treturn fmt.Errorf(\"segment cannot be empty\")\n\t}\n\n\t// Check for whitespace-only segment\n\tif strings.TrimSpace(segment) == \"\" {\n\t\treturn fmt.Errorf(\"segment cannot be only whitespace\")\n\t}\n\n\t// Check for single or double period\n\tif segment == \".\" || segment == \"..\" {\n\t\treturn fmt.Errorf(\"segment cannot be '.' or '..'\")\n\t}\n\n\t// Check for reserved prefix\n\tif strings.HasPrefix(segment, \"__\") {\n\t\treturn fmt.Errorf(\"%s cannot start with '__' (reserved prefix)\", segmentType)\n\t}\n\n\treturn nil\n}\n\n// IsAbsolutePath checks if a path is an absolute Firestore path\nfunc IsAbsolutePath(path string) bool {\n\treturn absolutePathRegex.MatchString(path)\n}\n\n// IsRelativePath checks if a path is a relative Firestore path\nfunc IsRelativePath(path string) bool {\n\treturn path != \"\" && !IsAbsolutePath(path)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/util/validator.go#L100-L136","documentation":"Segment guard in validateSegment: a path segment is '.' or '..', an attempt at relative traversal that Firestore paths do not support.","triggerScenarios":"Thrown at internal/tools/firestore/util/validator.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write out the literal path without dot segments","Use the exact collection IDs and document IDs in the path"],"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-08T10:18:20.063Z"}