Query Custom Post Type Items is a WordPress ability from Advanced Custom Fields — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Query Custom Post Type Items
Read-onlyList items from a specific AI-accessible ACF custom post type, with search and sorting.
Requires Advanced Custom Fields (ACF) 6.8.0+ on a WordPress install where the Abilities API is available (native from WordPress 6.9, or via a compatible Abilities/Feature API polyfill). ACF's global 'Allow AI Access' setting (enable_acf_ai) must be turned on, and each individual field group, custom post type, or custom taxonomy must also have its own 'Allow AI Access' toggle enabled and be exposed in the REST API (show_in_rest) before its abilities are registered. Most abilities additionally require the current user to hold ACF's configured management capability (acf_get_setting('capability'), default manage_options) or the matching WordPress post-type/taxonomy capability (create_posts, edit_posts, delete_posts, manage_terms, edit_terms, delete_terms).
What it does
ACF dynamically registers one of these query abilities for every custom post type that is active, has 'Allow AI Access' enabled, and is exposed in the REST API — the ability ID follows the pattern acf/{post-type-slug}s (e.g. acf/books). It proxies directly to that post type's WordPress REST API collection endpoint, so results follow the standard WP REST item schema plus any values from AI-accessible ACF field groups attached to the post type. Callers can filter by search term or slug, and control pagination and sort order.
See it in action
You ask your AI assistant
"List the 5 most recently published Books, sorted by title."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| per_page | integer | No | Number of items per page (1-100). Defaults to 10. |
| page | integer | No | Page of results to return. Defaults to 1. |
| search | string | No | Limit results to items matching a search string. |
| slug | array | No | Limit results to items with one or more specific slugs. |
| orderby | string | No | Sort collection by attribute: date, id, modified, relevance, slug, or title. Defaults to date. |
| order | string | No | Sort direction: asc or desc. Defaults to desc. |
Returns
A paginated array of items from the custom post type's REST API collection endpoint, including any AI-accessible ACF field values.
Permission
The current user must have the 'read' capability, or the post type's 'read_private_posts' capability.
More Advanced Custom Fields abilities
ACF Custom Post Types
List all ACF-registered custom post types that AI is allowed to access.
ACF Custom Taxonomies
List all ACF-registered custom taxonomies that AI is allowed to access.
Create Custom Post Type Item
Create a new item in a specific AI-accessible ACF custom post type.
Create Custom Taxonomy Term
Create a new term in a specific AI-accessible ACF custom taxonomy.
Delete Custom Post Type Item
Delete an item from a specific AI-accessible ACF custom post type by ID.
Delete Custom Taxonomy Term
Delete a term from a specific AI-accessible ACF custom taxonomy by ID.