Get ACF Field Value


Gets the current value of a single ACF field for a specific post, typed according to the field type.

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

 

Required access

Requirement Value
Capability edit_posts, edit_post (checked against the specific post)
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, e.g. "subtitle" or field_64f1a2c4.
post_id integer Yes — ID of the post/page/CPT entry the field is attached to.

 

Output schema

Field Type Required
field_key string
field_name string
field_type string
value string \| number \| integer \| boolean \| array \| object \| null

 

Example

Sample prompt
What's the subtitle set on post 42?

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 417,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__get-field-value",
    "arguments": {
      "input": {
        "field_key": "subtitle",
        "post_id": 42
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 417,
  "result": {
    "isError": false,
    "structuredContent": {
      "field_key": "field_64f1a2c4",
      "field_name": "subtitle",
      "field_type": "text",
      "value": "Hand-made in small batches"
    }
  }
}

 

Edge cases / errors

  • post_id does not match an existing post → acfa_invalid_post error.
  • Caller cannot edit that post → permission refused (edit_post is checked against the specific post).
  • field_key matches no ACF field name or key for the post → acfa_field_not_found error.
  • The value is returned formatted by ACF (e.g. an image field may come back as an array or URL depending on its return format).

 


<< Previous Next >>
Get ACF Field Object Get ACF Fields by Taxonomy Term

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.