{"record":{"id":"957208d96d99dbf9","repo":"googleapis/mcp-toolbox","slug":"filter-at-index-d-is-invalid-w","errorCode":null,"errorMessage":"filter at index %d is invalid: %w","messagePattern":"filter at index (.+?) is invalid: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/firestorequerycollection/firestorequerycollection.go","lineNumber":375,"sourceCode":"\n\tif len(filters) > maxFilterLength {\n\t\treturn nil, fmt.Errorf(errTooManyFilters, len(filters), maxFilterLength)\n\t}\n\n\tresult := make([]FilterConfig, 0, len(filters))\n\tfor i, filterRaw := range filters {\n\t\tfilterJSON, ok := filterRaw.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(errFilterNotString, i)\n\t\t}\n\n\t\tvar filter FilterConfig\n\t\tif err := json.Unmarshal([]byte(filterJSON), &filter); err != nil {\n\t\t\treturn nil, fmt.Errorf(errFilterParseFailed, i, err)\n\t\t}\n\n\t\tif err := filter.Validate(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"filter at index %d is invalid: %w\", i, err)\n\t\t}\n\n\t\tresult = append(result, filter)\n\t}\n\n\treturn result, nil\n}\n\n// parseOrderBy parses the orderBy configuration\nfunc (t Tool) parseOrderBy(orderByRaw interface{}) (*OrderByConfig, error) {\n\torderByJSON, ok := orderByRaw.(string)\n\tif !ok || orderByJSON == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tvar orderBy OrderByConfig\n\tif err := json.Unmarshal([]byte(orderByJSON), &orderBy); err != nil {\n\t\treturn nil, fmt.Errorf(errOrderByParseFailed, err)","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestorequerycollection/firestorequerycollection.go#L357-L393","documentation":"Validation wrap in parseFilters: the filter at the given index parsed as JSON but failed semantic validation (empty field, unsupported operator, or missing value); the wrapped error says which.","triggerScenarios":"Thrown at internal/tools/firestore/firestorequerycollection/firestorequerycollection.go:375 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the specific field/op/value problem named by the wrapped error","Remove the offending filter entry"],"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"}