github/github-mcp-server · error

updated_field.value is required

Error message

updated_field.value is required

What it means

Raised by parseBatchFieldSpec (pkg/github/projects_batch.go:510) when the updated_field object exists but contains no 'value' key. value is required because the batch tool updates one field across all items; note that presence is checked with a two-value map lookup, so a key explicitly set to null passes this check (and may fail later type conversion instead).

Source

Thrown at pkg/github/projects_batch.go:510

	return n, nil
}

type batchFieldSpec struct {
	id    int64
	name  string
	value any
}

func parseBatchFieldSpec(raw any) (batchFieldSpec, error) {
	var spec batchFieldSpec
	input, ok := raw.(map[string]any)
	if !ok || input == nil {
		return spec, fmt.Errorf("updated_field must be an object")
	}

	value, hasValue := input["value"]
	if !hasValue {
		return spec, fmt.Errorf("updated_field.value is required")
	}
	spec.value = value

	idField, hasID := input["id"]
	nameField, hasName := input["name"]
	switch {
	case hasID && hasName:
		return spec, fmt.Errorf("updated_field must set either id or name, not both")
	case !hasID && !hasName:
		return spec, fmt.Errorf("updated_field requires either id or name")
	case hasID:
		id, err := validatePositiveInt64(idField)
		if err != nil {
			return spec, fmt.Errorf("updated_field.id: %w", err)
		}
		spec.id = id
	default:
		name, ok := nameField.(string)

View on GitHub (pinned to 0ea1f775a7)

Solutions

  1. Add the value key: {"name": "Status", "value": "Done"}
  2. Check the spelling — it is exactly 'value', singular
  3. Decide the value once and apply it to the whole batch; per-item values are not supported by this tool
  4. Lint the payload: after name/id, assert a value key exists (even null must be intentional)

Example fix

// before
{"updated_field": {"name": "Status"}}
// after
{"updated_field": {"name": "Status", "value": "Done"}}
Defensive patterns

Strategy: validation

Validate before calling

if _, ok := spec["value"]; !ok {
	return fmt.Errorf("updated_field.value is required")
}

Type guard

func hasValueKey(spec map[string]any) bool { _, ok := spec["value"]; return ok }

Prevention

When it happens

Trigger: {"updated_field": {"name": "Status"}} — field identified but no value key at all. Also typos like "values", "val", or "field_value" leave the required key absent and trigger this error, failing the whole request up front.

Common situations: Typos in hand-written payloads; schema confusion between 'value' and 'option'; building the object conditionally and skipping the value assignment when a variable is empty.

Related errors


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/e810aeb08751872e. Report an issue: GitHub.