{"record":{"id":"0ec92dfdaa40080b","repo":"github/github-mcp-server","slug":"item-id-w","errorCode":null,"errorMessage":"item_id: %w","messagePattern":"item_id: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/projects_batch.go","lineNumber":423,"sourceCode":"\tswitch {\n\tcase formsPresent == 0:\n\t\treturn fmt.Errorf(\"each item requires exactly one of node_id, item_id, or item_owner + item_repo + issue_number\")\n\tcase formsPresent > 1:\n\t\treturn fmt.Errorf(\"each item must set exactly one of node_id, item_id, or item_owner + item_repo + issue_number, not more than one\")\n\t}\n\n\tswitch {\n\tcase hasNodeID:\n\t\ts, ok := entry[\"node_id\"].(string)\n\t\tif !ok || s == \"\" {\n\t\t\treturn fmt.Errorf(\"node_id must be a non-empty string\")\n\t\t}\n\t\tp.refKind = batchRefNodeID\n\t\tp.nodeID = s\n\tcase hasItemID:\n\t\tid, err := validatePositiveInt64(entry[\"item_id\"])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"item_id: %w\", err)\n\t\t}\n\t\tp.refKind = batchRefItemID\n\t\tp.itemID = id\n\tdefault:\n\t\tissueOwner, ownerErr := stringFromEntry(entry, \"item_owner\")\n\t\tissueRepo, repoErr := stringFromEntry(entry, \"item_repo\")\n\t\tissueNumber, numErr := intFromEntry(entry, \"issue_number\")\n\t\tfor _, err := range []error{ownerErr, repoErr, numErr} {\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"item_owner, item_repo, and issue_number must all be provided together: %w\", err)\n\t\t\t}\n\t\t}\n\t\tp.refKind = batchRefIssue\n\t\tp.issueOwner = issueOwner\n\t\tp.issueRepo = issueRepo\n\t\tp.issueNumber = issueNumber\n\t}\n\treturn nil","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/projects_batch.go#L405-L441","documentation":"Raised by parseItemRef (pkg/github/projects_batch.go:423) when item_id fails validatePositiveInt64. The underlying wrapped error (from pkg/github/projects.go:2320 and :484) is one of: 'value must be a number (got string/bool/nil)' for non-numeric JSON values, 'value must be a valid integer' for fractional floats like 1.5, or 'value must be greater than zero' for 0/negative. The item is rejected as 'invalid_item_ref'.","triggerScenarios":"{\"item_id\": \"123456\"} (quoted string), {\"item_id\": 1.5} or 1e9-with-fraction from JSON decoding, {\"item_id\": 0}, {\"item_id\": -5}, or {\"item_id\": null}. Only Go float64/int64/int are accepted — every JSON number decodes as float64 and must be integral.","commonSituations":"IDs quoted when serialized from a database or CSV; a default zero value leaking from a struct; nulls from optional columns; clients that send IDs as strings for precision safety elsewhere.","solutions":["Send item_id as an unquoted positive integer: {\"item_id\": 12345678}","If the ID arrives as a string, parse it to an int before building the request (do not forward it raw)","Guard against 0/null defaults before adding an item to the batch","If the value is actually a node ID string like \"PVTI_...\", use node_id instead"],"exampleFix":"// before\n{\"items\": [{\"item_id\": \"12345678\"}]}\n// after\n{\"items\": [{\"item_id\": 12345678}]}","handlingStrategy":"validation","validationCode":"if v, ok := entry[\"item_id\"]; ok {\n\tf, isNum := v.(float64) // JSON numbers decode to float64\n\tif !isNum || f != float64(int64(f)) || int64(f) <= 0 {\n\t\treturn fmt.Errorf(\"item_id must be a positive integer (got %v)\", v)\n\t}\n}","typeGuard":"func isPositiveJSONInt(v any) bool { f, ok := v.(float64); return ok && f == float64(int64(f)) && int64(f) > 0 }","tryCatchPattern":null,"preventionTips":["Convert string-typed IDs to integers at the boundary where you read them","Never forward raw CSV/database strings as numeric tool arguments","Filter zero/null ID defaults out of batch construction"],"tags":["github-projects","batch","input-validation","type-mismatch","item-id"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}