{"record":{"id":"0f82db24206acfea","repo":"googleapis/mcp-toolbox","slug":"invalid-jobstatematcher-s-supported-values-all","errorCode":null,"errorMessage":"invalid jobStateMatcher: %s. Supported values: ALL, ACTIVE, NON_ACTIVE","messagePattern":"invalid jobStateMatcher: (.+?)\\. Supported values: ALL, ACTIVE, NON_ACTIVE","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataproc/dataproc.go","lineNumber":299,"sourceCode":"\treq := &dataprocpb.ListJobsRequest{\n\t\tProjectId: s.Project,\n\t\tRegion:    s.Region,\n\t}\n\n\tif pageSize != nil {\n\t\treq.PageSize = int32(*pageSize)\n\t}\n\tif pageToken != \"\" {\n\t\treq.PageToken = pageToken\n\t}\n\tif filter != \"\" {\n\t\treq.Filter = filter\n\t}\n\tif jobStateMatcher != \"\" {\n\t\tif v, ok := dataprocpb.ListJobsRequest_JobStateMatcher_value[jobStateMatcher]; ok {\n\t\t\treq.JobStateMatcher = dataprocpb.ListJobsRequest_JobStateMatcher(v)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"invalid jobStateMatcher: %s. Supported values: ALL, ACTIVE, NON_ACTIVE\", jobStateMatcher)\n\t\t}\n\t}\n\n\tit := client.ListJobs(ctx, req)\n\tps := 0\n\tif pageSize != nil {\n\t\tps = *pageSize\n\t}\n\tpager := iterator.NewPager(it, ps, req.PageToken)\n\n\tvar jobPbs []*dataprocpb.Job\n\tnextPageToken, err := pager.NextPage(&jobPbs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list jobs: %w\", err)\n\t}\n\n\tjobs, err := ToJobs(jobPbs, s.Region)\n\tif err != nil {","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataproc/dataproc.go#L281-L317","documentation":"Thrown by ListJobs when the jobStateMatcher parameter is non-empty but is not one of the recognized protobuf enum names (ALL, ACTIVE, NON_ACTIVE). The library maps the string to dataprocpb.ListJobsRequest_JobStateMatcher and rejects unknown values before issuing the RPC.","triggerScenarios":"Calling the list-jobs tool with jobStateMatcher set to any string other than exactly \"ALL\", \"ACTIVE\", or \"NON_ACTIVE\" — e.g., lowercase \"active\", \"nonactive\", or a free-text filter.","commonSituations":"LLM or client generating case-incorrect values (\"active\"), hyphenated variants (\"non-active\"), or passing filter expressions into the matcher field by mistake.","solutions":["Use one of the exact uppercase values: ALL, ACTIVE, or NON_ACTIVE.","Correct case: \"active\" → \"ACTIVE\", \"non-active\" → \"NON_ACTIVE\".","If filtering by other criteria (e.g., job state time), put it in the filter parameter, not jobStateMatcher.","Omit jobStateMatcher entirely to use the API default."],"exampleFix":"// before\n{\"jobStateMatcher\": \"active\"}\n\n// after\n{\"jobStateMatcher\": \"ACTIVE\"}","handlingStrategy":"validation","validationCode":"var jobStateMatcher string\nvalid := map[string]bool{\"ALL\": true, \"ACTIVE\": true, \"NON_ACTIVE\": true}\nif jobStateMatcher != \"\" && !valid[jobStateMatcher] {\n    return fmt.Errorf(\"jobStateMatcher must be one of ALL, ACTIVE, NON_ACTIVE; got %q\", jobStateMatcher)\n}","typeGuard":"func validJobStateMatcher(s string) bool {\n    switch s {\n    case \"ALL\", \"ACTIVE\", \"NON_ACTIVE\", \"\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"jobs, err := src.ListJobs(ctx, ..., jobStateMatcher)\nif err != nil && strings.Contains(err.Error(), \"invalid jobStateMatcher\") {\n    // normalize input (uppercase, map \"non-active\"->\"NON_ACTIVE\") and retry once\n    return err\n}","preventionTips":["Always pass uppercase enum values: ALL, ACTIVE, NON_ACTIVE.","Normalize/uppercase client- or LLM-supplied input before calling the tool.","Use the separate filter parameter for non-state filtering criteria.","Omit jobStateMatcher when unsure; the API default applies."],"tags":["dataproc","validation","invalid-parameter","enum"],"backgroundTag":"invalid-enum-value","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"}