github/github-mcp-server · error

updated_field.name must be a non-empty string

Error message

updated_field.name must be a non-empty string

What it means

Raised by parseBatchFieldSpec (pkg/github/projects_batch.go:530) when updated_field uses the name form but the value is not a non-empty string — null, a number, a bool, or "". The field name must exactly match the Project V2 field's name; this error, however, fires earlier, on the type/emptiness check, and fails the whole request.

Source

Thrown at pkg/github/projects_batch.go:530

	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)
		if !ok || name == "" {
			return spec, fmt.Errorf("updated_field.name must be a non-empty string")
		}
		spec.name = name
	}
	return spec, nil
}

func resolveBatchProjectField(ctx context.Context, gqlClient *githubv4.Client, owner, ownerType string, projectNumber int, spec batchFieldSpec) (*ResolvedField, error) {
	if spec.name != "" {
		return resolveProjectFieldByName(ctx, gqlClient, owner, ownerType, projectNumber, spec.name, "")
	}

	fields, err := listAllProjectFields(ctx, gqlClient, owner, ownerType, projectNumber)
	if err != nil {
		return nil, err
	}

	id := fmt.Sprintf("%d", spec.id)
	for _, field := range fields {

View on GitHub (pinned to 0ea1f775a7)

Solutions

  1. Set name to the exact field name as a non-empty string, e.g. "Status"
  2. Fetch field names first via the list-project-fields tool and copy the exact spelling/case
  3. Guard configs: skip or fail fast when the configured field name is blank
  4. If you only have the numeric field database ID, use the id form instead

Example fix

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

Strategy: validation

Validate before calling

if v, ok := spec["name"]; ok {
	s, isStr := v.(string)
	if !isStr || s == "" {
		return fmt.Errorf("updated_field.name must be a non-empty string")
	}
}

Type guard

func isNonEmptyString(v any) bool { s, ok := v.(string); return ok && s != "" }

Prevention

When it happens

Trigger: "updated_field": {"name": null, "value": "Done"}, {"name": ""} from a blank config value, or {"name": 42}. All fail the string type assertion or the empty check at line 529.

Common situations: Empty template variables for the field name; config where the field name was never set and serialized as null; numeric field names from internal keys forwarded without mapping to the display name.

Related errors


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