{"record":{"id":"9b14503d924c589b","repo":"googleapis/mcp-toolbox","slug":"field-q-w","errorCode":null,"errorMessage":"field %q: %w","messagePattern":"field %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/util/converter.go","lineNumber":168,"sourceCode":"\t\t\t\t\treturn convertPlainMap(v, client)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Regular map without type annotation\n\t\treturn convertPlainMap(v, client)\n\tdefault:\n\t\t// Plain values (for backward compatibility)\n\t\treturn value, nil\n\t}\n}\n\n// convertPlainMap converts a plain map to Firestore format\nfunc convertPlainMap(m map[string]any, client *firestore.Client) (map[string]any, error) {\n\tresult := make(map[string]any)\n\tfor k, v := range m {\n\t\tconverted, err := JSONToFirestoreValue(v, client)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"field %q: %w\", k, err)\n\t\t}\n\t\tresult[k] = converted\n\t}\n\treturn result, nil\n}\n\n// isValidDocumentPath checks if a string is a valid Firestore document path\n// Valid paths have an even number of segments (collection/doc/collection/doc...)\nfunc isValidDocumentPath(path string) bool {\n\tif path == \"\" {\n\t\treturn false\n\t}\n\n\t// Split the path by '/' and check if it has an even number of segments\n\tsegments := splitPath(path)\n\treturn len(segments) > 0 && len(segments)%2 == 0\n}\n","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/util/converter.go#L150-L186","documentation":"Recursive wrap in convertPlainMap: converting one key of a plain (untyped) map to Firestore format failed; the field name and wrapped error identify the offending entry.","triggerScenarios":"Thrown at internal/tools/firestore/util/converter.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the named field according to the wrapped error","Ensure nested values use valid types or explicit Firestore value tags"],"exampleFix":null,"handlingStrategy":"try-catch","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"}