{"record":{"id":"a04df35cb1cd9a3a","repo":"github/github-mcp-server","slug":"updated-field-id-w-a04df3","errorCode":null,"errorMessage":"updated_field.id: %w","messagePattern":"updated_field\\.id: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/projects_batch.go","lineNumber":524,"sourceCode":"\t}\n\n\tvalue, hasValue := input[\"value\"]\n\tif !hasValue {\n\t\treturn spec, fmt.Errorf(\"updated_field.value is required\")\n\t}\n\tspec.value = value\n\n\tidField, hasID := input[\"id\"]\n\tnameField, hasName := input[\"name\"]\n\tswitch {\n\tcase hasID && hasName:\n\t\treturn spec, fmt.Errorf(\"updated_field must set either id or name, not both\")\n\tcase !hasID && !hasName:\n\t\treturn spec, fmt.Errorf(\"updated_field requires either id or name\")\n\tcase hasID:\n\t\tid, err := validatePositiveInt64(idField)\n\t\tif err != nil {\n\t\t\treturn spec, fmt.Errorf(\"updated_field.id: %w\", err)\n\t\t}\n\t\tspec.id = id\n\tdefault:\n\t\tname, ok := nameField.(string)\n\t\tif !ok || name == \"\" {\n\t\t\treturn spec, fmt.Errorf(\"updated_field.name must be a non-empty string\")\n\t\t}\n\t\tspec.name = name\n\t}\n\treturn spec, nil\n}\n\nfunc resolveBatchProjectField(ctx context.Context, gqlClient *githubv4.Client, owner, ownerType string, projectNumber int, spec batchFieldSpec) (*ResolvedField, error) {\n\tif spec.name != \"\" {\n\t\treturn resolveProjectFieldByName(ctx, gqlClient, owner, ownerType, projectNumber, spec.name, \"\")\n\t}\n\n\tfields, err := listAllProjectFields(ctx, gqlClient, owner, ownerType, projectNumber)","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/projects_batch.go#L506-L542","documentation":"Raised by parseBatchFieldSpec (pkg/github/projects_batch.go:524) when updated_field.id fails validatePositiveInt64. The wrapped cause is one of: 'value must be a number (got string)' for quoted IDs, 'value must be a valid integer' for fractional floats, or 'value must be greater than zero' for 0/negative. This fails the whole request before any item is processed.","triggerScenarios":"\"updated_field\": {\"id\": \"123456\", \"value\": ...} (string), {\"id\": 1.5}, {\"id\": 0}, {\"id\": null}, or {\"id\": -1}. Only unquoted integral numbers survive validateAndConvertToInt64 plus the > 0 check.","commonSituations":"Field IDs quoted after being stored as strings in config; a zero default when the ID lookup failed; mixing up the project number, project ID (\"PVT_...\"), and the numeric field database ID — only the last belongs here.","solutions":["Send id as an unquoted positive integer taken from a list_project_fields result","If your config stores IDs as strings, convert to int before building the request","Verify you are using the field's database ID, not the project ID or project number","Pre-validate id > 0 and integral before the call"],"exampleFix":"// before\n{\"updated_field\": {\"id\": \"MDExOlByb2plY3RmaWVsZDEyMzQ=\", \"value\": \"Done\"}}\n// after\n{\"updated_field\": {\"id\": 123456, \"value\": \"Done\"}}\n// or use the name form: {\"name\": \"Status\", \"value\": \"Done\"}","handlingStrategy":"validation","validationCode":"if v, ok := spec[\"id\"]; ok {\n\tf, isNum := v.(float64)\n\tif !isNum || f != float64(int64(f)) || int64(f) <= 0 {\n\t\treturn fmt.Errorf(\"updated_field.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":["Store field IDs as numbers, not strings, wherever they are configured","Confirm the value is the field database ID from list_project_fields — not the project ID or project number","When in doubt, switch to the name form, which is human-verifiable"],"tags":["github-projects","batch","input-validation","type-mismatch","updated-field"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}