{"record":{"id":"737b1256e0f7d3cf","repo":"googleapis/mcp-toolbox","slug":"s-cannot-start-with-reserved-prefix","errorCode":null,"errorMessage":"%s cannot start with '__' (reserved prefix)","messagePattern":"(.+?) cannot start with '__' \\(reserved prefix\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/util/validator.go","lineNumber":123,"sourceCode":"\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)\n}\n","sourceCodeStart":105,"sourceCodeEnd":138,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/util/validator.go#L105-L138","documentation":"Segment guard in validateSegment: the collection ID or document ID starts with '__', a prefix Firestore reserves for internal collections and does not allow in user paths.","triggerScenarios":"Thrown at internal/tools/firestore/util/validator.go:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the segment to drop the leading '__'","Use a different prefix such as 'meta_' for user-created identifiers"],"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"}