{"record":{"id":"4554a6b0ac5af042","repo":"googleapis/mcp-toolbox","slug":"filter-field-cannot-be-empty","errorCode":null,"errorMessage":"filter field cannot be empty","messagePattern":"filter field cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/firestorequerycollection/firestorequerycollection.go","lineNumber":209,"sourceCode":"// validate interface\nvar _ tools.Tool = Tool{}\n\n// Tool represents the Firestore query collection tool\ntype Tool struct {\n\ttools.BaseTool[Config]\n}\n\n// FilterConfig represents a filter for the query\ntype FilterConfig struct {\n\tField string      `json:\"field\"`\n\tOp    string      `json:\"op\"`\n\tValue interface{} `json:\"value\"`\n}\n\n// Validate checks if the filter configuration is valid\nfunc (f *FilterConfig) Validate() error {\n\tif f.Field == \"\" {\n\t\treturn fmt.Errorf(\"filter field cannot be empty\")\n\t}\n\n\tif !validOperators[f.Op] {\n\t\tops := make([]string, 0, len(validOperators))\n\t\tfor op := range validOperators {\n\t\t\tops = append(ops, op)\n\t\t}\n\t\treturn fmt.Errorf(errInvalidOperator, f.Op, ops)\n\t}\n\n\tif f.Value == nil {\n\t\treturn fmt.Errorf(errMissingFilterValue, f.Field)\n\t}\n\n\treturn nil\n}\n\n// OrderByConfig represents ordering configuration","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestorequerycollection/firestorequerycollection.go#L191-L227","documentation":"Filter-validation guard in FilterConfig.Validate: a filter object from the filters parameter parsed successfully but its `field` member is missing or empty, so there is nothing to filter on.","triggerScenarios":"Thrown at internal/tools/firestore/firestorequerycollection/firestorequerycollection.go:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include a non-empty `field` in every filter JSON object","Remove malformed filter entries from the filters array"],"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"}