๐ Day 6 of 30 ยท Week 1: Get the Stack ยท โฑ 12 minutes
What Is the Abilities API?
The Abilities API is a framework built into WordPress core (since version 6.9) that makes WordPress AI-discoverable. Think of it as a registry where plugins and themes declare what they can do โ and AI agents can read that registry to understand what actions are available.
Without the Abilities API, an AI agent connecting to WordPress would need to know every REST API endpoint, every plugin’s custom routes, every theme’s capabilities. With Abilities, each plugin simply declares: “I can do X, Y, Z โ here’s how to invoke me.”
๐ง Tool: Abilities API โ WordPress core feature (6.9+). Register capabilities via wp_register_ability(). AI agents discover them through the /wp-json/wp-abilities/v1/abilities endpoint. Developer docs โ
How It Works
The Abilities API has three parts:
- Registration โ A plugin or theme calls
wp_register_ability()to declare what it can do - Discovery โ AI agents query the REST endpoint
/wp-json/wp-abilities/v1/abilitiesto see all registered abilities - Invocation โ The agent calls the ability’s callback, which executes the action
Here’s what a simple ability registration looks like in PHP:
// 1. Register a category for your abilities (slug allows lowercase + dashes only).
add_action( 'wp_abilities_api_categories_init', function () {
wp_register_ability_category( 'newsroom-content', array(
'label' => 'Newsroom Content',
'description' => 'Abilities for generating editorial content.',
) );
} );
// 2. Register the ability on the abilities init hook.
add_action( 'wp_abilities_api_init', function () {
wp_register_ability( 'my-plugin/generate-newsletter', array(
'label' => 'Generate Newsletter',
'description' => 'Creates a newsletter draft from recent published posts.',
'category' => 'newsroom-content',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
},
'execute_callback' => 'my_generate_newsletter_handler',
'input_schema' => array(
'type' => 'object',
'properties' => array(
'date_range' => array(
'type' => 'string',
'description' => 'Time period to pull posts from (e.g., "last 7 days").',
'default' => 'last 7 days',
),
'max_posts' => array(
'type' => 'integer',
'description' => 'Maximum number of posts to include.',
'default' => 5,
),
),
),
'meta' => array( 'show_in_rest' => true ),
) );
} );
Why This Matters for Editorial Teams
As a non-developer, you don’t need to write PHP. But understanding Abilities helps you:
- Know what’s possible โ When you connect Claude to your site via MCP, the abilities it discovers determine what it can do. More abilities = more powerful AI workflows.
- Request the right plugins โ Tell your engineering team: “We need an ability for X” instead of “Can you build an API for X?” They’ll know exactly what to build.
- Evaluate plugins โ Plugins that register abilities are AI-ready. Those that don’t are invisible to AI agents. This becomes a key evaluation criterion.
Try It: View Abilities on Your Site
On any WordPress 6.9+ site, you can see registered abilities by visiting:
# In your browser
https://your-site.com/wp-json/wp-abilities/v1/abilities
# Or via WP-CLI in Studio
studio wp --path ~/Studio/my-newsroom eval 'foreach (wp_get_abilities() as $a) echo $a->get_name().PHP_EOL;'
On a fresh WordPress install, you’ll see core abilities like content management and site settings. As you add plugins that support the Abilities API, the list grows โ and so does what AI agents can do with your site.
The Big Picture: Abilities + MCP
Here’s how the pieces fit together:
- Abilities API = the menu (what’s available)
- MCP = the waiter (connects AI to the menu)
- Claude/Studio Code = the customer (reads the menu, places orders)
An AI agent connects via MCP, discovers abilities, and uses them. The more abilities your site registers, the more your AI agents can do. In Week 4, you’ll learn how to create custom abilities for your specific newsroom workflows.
โ Key Takeaway: The Abilities API makes WordPress AI-discoverable. It’s the foundation layer โ without it, AI agents are flying blind. With it, they know exactly what your site can do and how to do it.
โ Day 5: The WordPress AI plugin ยท Day 7: Week 1 Review โ
