{"record":{"id":"e6e5e1b615505a2c","repo":"github/github-mcp-server","slug":"updated-field-requires-either-id-or-name-e6e5e1","errorCode":null,"errorMessage":"updated_field requires either id or name","messagePattern":"updated_field requires either id or name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/projects_batch.go","lineNumber":520,"sourceCode":"\tvar spec batchFieldSpec\n\tinput, ok := raw.(map[string]any)\n\tif !ok || input == nil {\n\t\treturn spec, fmt.Errorf(\"updated_field must be an object\")\n\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 != \"\" {","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/projects_batch.go#L502-L538","documentation":"Raised by parseBatchFieldSpec (pkg/github/projects_batch.go:520) when the updated_field object contains neither 'id' nor 'name', leaving the library with no way to identify which project field to update. It fails the entire request up front, before items are parsed or any network call is made.","triggerScenarios":"{\"updated_field\": {\"value\": \"Done\"}} — only the value is supplied. Also field names spelled differently (\"field\", \"field_name\", \"key\") leave both identifier keys absent.","commonSituations":"Schema confusion where the caller assumes the field is positional or inferred from the value; renaming between tool versions; hand-built JSON that forgot the identifier property.","solutions":["Add exactly one identifier: \"name\": \"Status\" (resolved by name) or \"id\": 123456 (numeric field database ID)","If unsure of exact field names, call the list-project-fields tool first and copy the name or id from it","Note id must be the field's database ID, not the project ID","Validate the object has (id XOR name) plus value before sending"],"exampleFix":"// before\n{\"updated_field\": {\"value\": \"Done\"}}\n// after\n{\"updated_field\": {\"name\": \"Status\", \"value\": \"Done\"}}","handlingStrategy":"validation","validationCode":"_, hasID := spec[\"id\"]\n_, hasName := spec[\"name\"]\nif !hasID && !hasName {\n\treturn fmt.Errorf(\"updated_field requires id or name\")\n}","typeGuard":"func hasExactlyOneFieldID(spec map[string]any) bool {\n\t_, id := spec[\"id\"]\n\t_, name := spec[\"name\"]\n\treturn id != name\n}","tryCatchPattern":null,"preventionTips":["Fetch field metadata (list_project_fields) first and carry name or id from it","Use the exact keys 'id'/'name' — not field, field_name, or key","Validate the spec object shape in one place before every call"],"tags":["github-projects","batch","input-validation","missing-key","updated-field"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}