{"record":{"id":"87fcab06750e837b","repo":"googleapis/mcp-toolbox","slug":"failed-to-parse-orderby-w","errorCode":null,"errorMessage":"failed to parse orderBy: %w","messagePattern":"failed to parse orderBy: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/firestorequerycollection/firestorequerycollection.go","lineNumber":393,"sourceCode":"\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)\n\t}\n\n\tif orderBy.Field == \"\" {\n\t\treturn nil, nil\n\t}\n\n\treturn &orderBy, nil\n}\n","sourceCodeStart":375,"sourceCodeEnd":402,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestorequerycollection/firestorequerycollection.go#L375-L402","documentation":"JSON-decode wrap in parseOrderBy: the orderBy parameter string is not valid JSON, so it cannot be unmarshalled into an OrderByConfig.","triggerScenarios":"Thrown at internal/tools/firestore/firestorequerycollection/firestorequerycollection.go:393 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send orderBy as a JSON object string like '{\"field\":\"age\",\"direction\":\"ASCENDING\"}'","Fix JSON syntax errors (quotes, commas, braces)"],"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"}