Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ACF 6.8 register-custom-post-type ability exposes an MCP schema rejected by ChatGPT/OpenAI strict validation

未关闭
#1,035 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
php

调研方向

从 src/AI/Abilities/PostType.php 开始,检查 supports schema 以及 taxonomies schema。验证 supports 在运行时的表示方式,然后添加缺失的 item 定义,或将文档中说明的对象形式值与已发布的 schema 进行协调。添加自动化回归检查,根据严格的 OpenAI-compatible tool-schema 要求验证公开的 ability。

由索引模型根据 Issue 内容生成。

描述

Summary

The ACF 6.8 acf/register-custom-post-type ability currently exposes an input schema that cannot be loaded by ChatGPT's MCP client.

When the ability is exposed as an MCP tool, ChatGPT rejects the tool during tool discovery with:

Invalid MCP tool schema for tool 'wp_ability_acf_register_custom_post_type'

I traced the issue to the schema definition of the supports property in src/AI/Abilities/PostType.php.

Environment

  • ACF PRO: 6.8.10
  • WordPress: 7.1
  • PHP: 8.3.33
  • MCP adapter: Easy MCP AI 1.7.17
  • Client: ChatGPT Custom MCP
  • Date tested: 2026-09-15

Steps to reproduce

  1. Enable ACF AI abilities:
add_filter( 'acf/settings/enable_acf_ai', '__return_true' );
  1. Expose acf/register-custom-post-type as an MCP tool.
  2. Connect the WordPress MCP server to ChatGPT.
  3. Refresh/discover MCP tools.

ChatGPT rejects the tool schema and the MCP tool refresh fails.

Suspected root cause

The current schema defines supports as an array without an items schema:

'supports' => array(
    'type'        => 'array',
    'description' => 'Features the post type supports...',
    'required'    => false,
),

However, another array property in the same ability, taxonomies, correctly includes an items definition:

'taxonomies' => array(
    'type'        => 'array',
    'description' => 'Array of taxonomy names...',
    'items'       => array(
        'type' => 'string',
    ),
    'required'    => false,
),

Strict OpenAI-compatible tool-schema validators reject array schemas without an items definition.

This is particularly problematic for an ability specifically intended to make ACF interoperable with external AI/MCP clients.

There also appears to be a contract mismatch around supports: the description/runtime behavior indicates support for both indexed arrays and associative/object-style values, while the published schema declares only type: array.

Expected behavior

acf/register-custom-post-type should expose a tool schema that can be successfully discovered and loaded by major MCP clients, including ChatGPT/OpenAI-compatible clients.

Actual behavior

Tool discovery fails when this ability is enabled.

ChatGPT displays:

Invalid MCP tool schema for tool 'wp_ability_acf_register_custom_post_type'

Disabling only the acf/register-custom-post-type MCP tool allows tool discovery to continue.

Suggested fix

At minimum, define the item type for supports:

'supports' => array(
    'type'        => 'array',
    'items'       => array(
        'type' => 'string',
    ),
    'description' => 'Features the post type supports...',
    'required'    => false,
),

The documented/runtime support for associative/object-style supports values should also be reconciled with the published ability schema.

I would also suggest adding an automated schema compatibility/regression test for all ACF Abilities exposed through MCP, particularly against strict OpenAI-compatible tool-schema validation.

This class of issue is straightforward to catch automatically before release by validating every exposed ability schema and failing CI when an array schema required by a target client is missing its items definition.

Additional observation

The same area may deserve a broader schema audit rather than treating this as a single-property typo.

For example, other ACF AI/Abilities schemas should be checked for arrays without explicit item definitions and for mismatches between runtime-supported values and the machine-readable schema.

Reproduction evidence

I can provide a screenshot of ChatGPT failing MCP tool refresh with:

Invalid MCP tool schema for tool 'wp_ability_acf_register_custom_post_type'

Reported by Süha Karalar
https://www.suhakaralar.com

Image
主要语言
PHP
星标
946
派生
197
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AdvancedCustomFields/acf 的其他 Issue

查看 AdvancedCustomFields/acf 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。