Create ACF Field Group


Programmatically registers a new ACF field group with initial fields and location rules. Structural change: alters site-wide content modeling.

Property Value
Ability slug mosmcp/create-field-group
Wire tool name mosmcp__create-field-group
Category Advanced Custom Fields (mosmcp-acf)
Plan Free

 

Required access

Requirement Value
Capability manage_options
Minimum default role Administrator
Requires Advanced Custom Fields
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
title string Yes — Display title for the new field group.
fields object[] Yes — Initial field definitions. Each item needs at least name, label, and type (e.g. text, number, select).
location_rules array[] Yes — ACF location rule groups (array of arrays of {param, operator, value}), e.g. [[{"param":"post_type","operator":"==","value":"page"}]].
menu_order integer — Sort order relative to other field groups.

 

Output schema

Field Type Required
success boolean
group_key string
group object

 

Example

Sample prompt
Create a 'Event Details' field group for posts with a date field and a venue text field.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 413,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__create-field-group",
    "arguments": {
      "input": {
        "title": "Event Details",
        "fields": [
          {
            "name": "event_date",
            "label": "Event Date",
            "type": "date_picker"
          },
          {
            "name": "venue",
            "label": "Venue",
            "type": "text"
          }
        ],
        "location_rules": [
          [
            {
              "param": "post_type",
              "operator": "==",
              "value": "post"
            }
          ]
        ]
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 413,
  "result": {
    "isError": false,
    "structuredContent": {
      "success": true,
      "group_key": "group_66f9a1c2b3d4e",
      "group": {
        "ID": 204,
        "key": "group_66f9a1c2b3d4e",
        "title": "Event Details",
        "active": true,
        "location": [
          [
            {
              "param": "post_type",
              "operator": "==",
              "value": "post"
            }
          ]
        ],
        "fields": [
          {
            "key": "field_66f9a1c2b3d51",
            "name": "event_date",
            "label": "Event Date",
            "type": "date_picker"
          }
        ]
      }
    }
  }
}

 

Edge cases / errors

  • Caller lacks ACF's configured admin capability (default manage_options) → acfa_forbidden.
  • Empty title, fields or location_rules → acfa_missing_title, acfa_missing_fields or acfa_missing_location.
  • Any field without name and type → acfa_invalid_field naming its index; missing keys (including nested sub-fields and layouts) are generated automatically.
  • Not idempotent: each call creates a new, active group with a fresh key; ACF failing to save → acfa_create_failed.

 


<< Previous Next >>
Clear ACF Field Value Get ACF Conditional Logic Rules

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.