Validate ACF Field Value


Runs ACF's built-in validation logic against a proposed value before committing it, without saving. Recommended pre-flight before update-field-value and bulk-update-fields.

Property Value
Ability slug mosmcp/validate-field-value
Wire tool name mosmcp__validate-field-value
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 key to validate against.
value any Yes — Proposed value to check.
post_id integer — Optional post context, needed for conditional-logic-aware validation.

 

Output schema

Field Type Required
valid boolean
errors string[]

 

Example

Sample prompt
Before saving, check whether 'purple' is an allowed value for the color field.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 433,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__validate-field-value",
    "arguments": {
      "input": {
        "field_key": "color",
        "value": "purple"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 433,
  "result": {
    "isError": false,
    "structuredContent": {
      "valid": false,
      "errors": [
        "Color value is not a valid choice."
      ]
    }
  }
}

 

Edge cases / errors

  • field_key matches no ACF field → acfa_field_not_found error.
  • Nothing is ever saved; the result is only valid plus any ACF validation messages (HTML stripped).
  • A field referenced by name may need post_id to resolve in the right context.

 


<< Previous Next >>
Update ACF Repeater Row

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.