Description
WindPress registers several abilities (e.g., windpress/get-config, windpress/get-volume-entries, windpress/get-volume-handlers) with 'input_schema' => [] (empty array).
The WordPress Abilities API (WP_Ability::invoke_callback() in wp-includes/abilities-api/class-wp-ability.php, lines 505-512) checks:
if ( ! empty( $this->get_input_schema() ) ) {
$args[] = $input;
}
return $callback( ...$args );
When input_schema is empty, no argument is passed to the callback. But WindPress ability classes declare $input as a required parameter without a default value:
// windpress/src/Abilities/Abilities/GetConfig.php:35
public static function execute($input): array
This causes:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function
WindPress\WindPress\Abilities\Abilities\GetConfig::execute(),
0 passed in .../class-wp-ability.php on line 511 and exactly 1 expected
Affected abilities
All abilities registered without input_schema (or with 'input_schema' => []):
windpress/get-config (Loader.php:175)
windpress/get-volume-entries (Loader.php:218)
windpress/get-volume-handlers (Loader.php:336)
Steps to reproduce
$ability = wp_get_ability('windpress/get-config');
$result = $ability->execute(null); // Crashes with ArgumentCountError
Or via WP-CLI:
wp eval "\$a = wp_get_ability('windpress/get-config'); var_dump(\$a->execute(null));" --user=1
Suggested fix
Option A — Add default value to all ability callback signatures:
- public static function execute($input): array
+ public static function execute($input = []): array
This applies to: GetConfig.php, GetVolumeEntries.php, GetVolumeHandlers.php, GetVolumeEntry.php, SaveVolumeEntry.php, SaveVolumeEntries.php, DeleteVolumeEntry.php, ResetVolumeEntry.php.
Option B — Register abilities that don't need input with a proper empty JSON Schema object instead of an empty array:
- 'input_schema' => [],
+ 'input_schema' => ['type' => 'object', 'properties' => new \stdClass()],
Option A is the minimal fix. Option B is more correct per JSON Schema spec.
Environment
- WordPress: 6.9.3
- WindPress: latest (installed from wp.org)
- MCP Adapter: 0.4.1
- PHP: 8.3
Context
Discovered while building an AI assistant that auto-discovers WordPress abilities via wp_get_abilities() and exposes them as tools. The core abilities (core/get-site-info, core/get-user-info, core/get-environment-info) work correctly — their callbacks use $input = array() as default.
Description
WindPress registers several abilities (e.g.,
windpress/get-config,windpress/get-volume-entries,windpress/get-volume-handlers) with'input_schema' => [](empty array).The WordPress Abilities API (
WP_Ability::invoke_callback()inwp-includes/abilities-api/class-wp-ability.php, lines 505-512) checks:When
input_schemais empty, no argument is passed to the callback. But WindPress ability classes declare$inputas a required parameter without a default value:This causes:
Affected abilities
All abilities registered without
input_schema(or with'input_schema' => []):windpress/get-config(Loader.php:175)windpress/get-volume-entries(Loader.php:218)windpress/get-volume-handlers(Loader.php:336)Steps to reproduce
Or via WP-CLI:
Suggested fix
Option A — Add default value to all ability callback signatures:
This applies to:
GetConfig.php,GetVolumeEntries.php,GetVolumeHandlers.php,GetVolumeEntry.php,SaveVolumeEntry.php,SaveVolumeEntries.php,DeleteVolumeEntry.php,ResetVolumeEntry.php.Option B — Register abilities that don't need input with a proper empty JSON Schema object instead of an empty array:
Option A is the minimal fix. Option B is more correct per JSON Schema spec.
Environment
Context
Discovered while building an AI assistant that auto-discovers WordPress abilities via
wp_get_abilities()and exposes them as tools. The core abilities (core/get-site-info,core/get-user-info,core/get-environment-info) work correctly — their callbacks use$input = array()as default.