Get ACF Field Object


Gets field metadata (type, choices, sub-fields, conditional logic, default value) rather than the stored value — needed before attempting a write.

Property Value
Ability slug mosmcp/get-field-object
Wire tool name mosmcp__get-field-object
Category Advanced Custom Fields (mosmcp-acf)
Plan Free

 

Required access

Requirement Value
Capability edit_posts
Minimum default role Contributor
Requires Advanced Custom Fields
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
field_key string Yes — Field name or field key.
post_id integer — Optional post context, required for fields with per-post conditional logic.

 

Output schema

Field Type Required
(result) object

 

Example

Sample prompt
What options can I choose from for the 'color' field before I change it?

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 416,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__get-field-object",
    "arguments": {
      "input": {
        "field_key": "color"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 416,
  "result": {
    "isError": false,
    "structuredContent": {
      "key": "field_64f1a2d9",
      "label": "Color",
      "name": "color",
      "type": "select",
      "instructions": "Pick the main product color.",
      "choices": {
        "red": "Red",
        "blue": "Blue"
      },
      "default_value": "red",
      "conditional_logic": 0
    }
  }
}

 

Edge cases / errors

  • field_key matches no ACF field → acfa_field_not_found error.
  • A field referenced by name (not key) may only resolve when a post_id is supplied, because ACF looks up the name in that post's context.
  • The stored value is never included; the response is the field definition only (value, prefix, _name, _valid are stripped).
  • Only edit_posts is checked; post_id is used as context, not for a per-post permission check.

 


<< Previous Next >>
Get ACF Field Group Get ACF Field Value

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.