{"record":{"id":"fb00d41747788798","repo":"googleapis/mcp-toolbox","slug":"array-item-d-w","errorCode":null,"errorMessage":"array item %d: %w","messagePattern":"array item (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/util/converter.go","lineNumber":114,"sourceCode":"\t\t\t\t\t\tlat, latOk := geoMap[\"latitude\"].(float64)\n\t\t\t\t\t\tlng, lngOk := geoMap[\"longitude\"].(float64)\n\t\t\t\t\t\tif latOk && lngOk {\n\t\t\t\t\t\t\treturn &latlng.LatLng{\n\t\t\t\t\t\t\t\tLatitude:  lat,\n\t\t\t\t\t\t\t\tLongitude: lng,\n\t\t\t\t\t\t\t}, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid geopoint value format\")\n\t\t\t\tcase \"arrayValue\":\n\t\t\t\t\t// Convert array\n\t\t\t\t\tif arrayMap, ok := val.(map[string]any); ok {\n\t\t\t\t\t\tif values, ok := arrayMap[\"values\"].([]any); ok {\n\t\t\t\t\t\t\tresult := make([]any, len(values))\n\t\t\t\t\t\t\tfor i, item := range values {\n\t\t\t\t\t\t\t\tconverted, err := JSONToFirestoreValue(item, client)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"array item %d: %w\", i, err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tresult[i] = converted\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn result, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid array value format\")\n\t\t\t\tcase \"mapValue\":\n\t\t\t\t\t// Convert map\n\t\t\t\t\tif mapMap, ok := val.(map[string]any); ok {\n\t\t\t\t\t\tif fields, ok := mapMap[\"fields\"].(map[string]any); ok {\n\t\t\t\t\t\t\tresult := make(map[string]any)\n\t\t\t\t\t\t\tfor k, v := range fields {\n\t\t\t\t\t\t\t\tconverted, err := JSONToFirestoreValue(v, client)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"map field %q: %w\", k, err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tresult[k] = converted","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/util/converter.go#L96-L132","documentation":"Recursive wrap in JSONToFirestoreValue for arrayValue: converting one element of the array failed; the index and the wrapped error identify the offending element and its specific problem.","triggerScenarios":"Thrown at internal/tools/firestore/util/converter.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the array element named by the index according to the wrapped error","Ensure every element carries a valid Firestore value tag"],"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-08T15:18:49.778Z"}