Ten plugins, ten APIs
A typical client site runs an SEO plugin, a form, a store, a cache and half a dozen more extensions. Each can do something useful: show a page's SEO meta, clear the cache, create a coupon. And each exposes it in its own way: its own admin page, its own REST route, its own AJAX action, its own docs, or none at all.
Now imagine an AI agent connects to the site and asks: "What can you do?" The site can't answer. There is no single place that records what it can do and who is allowed to do it.
The Abilities API is that place.
Agenda
In 10 minutes you will:
- say what the Abilities API is in one sentence;
- take apart the three parts an ability is made of;
- see the abilities WordPress core already has;
- find your site's ability registry through REST and WP-CLI.
Theory
Definition
The Abilities API is the list of what your site can do and what it allows. Nothing more, nothing else.
It has been part of WordPress core since 6.9. Core, the theme and plugins add their actions to the list. Each such action is an ability.
The three parts of an ability
| Part | What it answers | Example |
|---|---|---|
| What it is | name namespace/action, label, description, category | forwp-seo-helper/get-meta |
| What it takes and returns | input_schema and output_schema (JSON Schema) | ID or slug → SEO title, description |
| Who is allowed | permission_callback | current_user_can( 'edit_posts' ) |
Plus execute_callback, the code that performs the action, and meta with hints: whether the action only reads (readonly), destroys something (destructive), or gives the same result when called again (idempotent).
What an ability looks like in code
A real registration from our plugin 4WP SEO Helper (shortened):
add_action( 'wp_abilities_api_init', function () {
wp_register_ability(
'forwp-seo-helper/get-meta',
array(
'label' => __( 'Get SEO meta of a post', '4wp-seo-helper' ),
'description' => __( 'SEO meta of one post or page by ID or slug.', '4wp-seo-helper' ),
'category' => 'forwp-seo-helper',
'input_schema' => array( /* id or slug */ ),
'output_schema' => array( /* raw and effective SEO meta */ ),
'execute_callback' => array( $this, 'get_meta' ),
'permission_callback' => array( $this, 'can_read' ), // current_user_can( 'edit_posts' )
'meta' => array(
'annotations' => array(
'readonly' => true,
'destructive' => false,
'idempotent' => true,
),
),
)
);
} );
The plugin describes what it can do. It doesn't care who calls it: PHP code, a REST client, a block in the editor or an AI agent. We'll go through registration in detail in module 2.
What core already has
WordPress registers its own categories (site, user) and abilities:
| Ability | What it returns | Who is allowed |
|---|---|---|
core/get-site-info | name, description, URL, language, WordPress version | manage_options |
core/get-user-info | the current user's data | anyone logged in |
core/get-environment-info | environment: PHP, database, environment type | manage_options |
Note: even "just site info" is available only to an administrator. Permissions are part of the ability, not an add-on.
One registry, many doors
flowchart LR
C["Core"] --> R["wp_register_ability"]
T["Theme"] --> R
P["Plugins"] --> R
R --> REG["Registry"]
REG --> PHP["PHP<br/>wp_get_abilities()"]
REG --> REST["REST<br/>/wp-json/wp-abilities/v1/"]
REG --> JS["JavaScript"]
REG --> MCP["MCP Adapter → AI app"]
- Register. Categories on the
wp_abilities_api_categories_inithook, abilities onwp_abilities_api_init. - Registry. Everything goes into one registry:
wp_get_abilities(),wp_get_ability(),wp_has_ability(). - Check. Before running, WordPress validates the input against the schema and calls
permission_callback. - Call. The same list is available in PHP, through REST, in JavaScript and through the MCP Adapter for AI apps.
Code / commands
# Abilities an administrator can see
curl -s https://site.test/wp-json/wp-abilities/v1/abilities -u admin:'APP PASS WORD' | jq '.[].name'
# Categories
curl -s https://site.test/wp-json/wp-abilities/v1/categories -u admin:'APP PASS WORD' | jq '.[].slug'
# The same from PHP
wp eval 'foreach ( wp_get_abilities() as $a ) { echo $a->get_name(), PHP_EOL; }'
# Call a read-only ability: GET + /run
curl -s https://site.test/wp-json/wp-abilities/v1/abilities/core/get-site-info/run -u admin:'APP PASS WORD'
REST shows only abilities with meta.show_in_rest (or meta.public). By default an ability is not shown in REST: a deliberate decision in core.
Trade-offs
| Option | Simpler | Costs more | When to choose |
|---|---|---|---|
| Your own REST route for each action | a familiar tool | every client learns your API separately; AI knows nothing about it | only your own front end needs the action |
| Ability | one standard, schemas and permissions in one place, available to REST and MCP | you need to think through the name, schemas, permissions | different clients will call the action, AI among them |
| Both | REST for your own UI, an ability for everyone else | two contracts to maintain | a large plugin with its own interface |
The course principle: start simple. Not every function deserves to become an ability, only actions a person will actually ask for.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
The ability isn't in /wp-abilities/v1/abilities | show_in_rest is not enabled | meta.show_in_rest => true (module 2) |
wp_register_ability triggers _doing_it_wrong | called outside the wp_abilities_api_init hook | register only on this hook |
A guest gets 401 on /wp-abilities/v1/abilities | the list is available only to logged-in users (read) | request with an Application Password |
| "The Abilities API is a plugin" | confusion with the Feature Plugin before 6.9 | since WordPress 6.9 it's core |
Practice
- Create an Application Password for the administrator of a local site.
- Get the list of abilities through REST and through
wp eval. - Call
core/get-site-infothrough/runand find the WordPress version in the response.
Result: you see the list of what your site can do, and you got a response from one ability.
Quiz
- The Abilities API is: a) a plugin for AI; b) the list of what a site can do and allows; c) a new REST namespace for posts.
- Which part of an ability decides who may call it?
- On which hook are abilities registered?
- Why doesn't
core/get-site-infoanswer a guest?
<details> <summary>Answers</summary>
- b.
permission_callback.wp_abilities_api_init(categories:wp_abilities_api_categories_init).- Its
permission_callbackrequiresmanage_options.
</details>
FAQ
No. Since WordPress 6.9 the Abilities API is part of core. A separate plugin (MCP Adapter) is needed only to hand abilities to AI apps through MCP.
A REST route is an address for HTTP requests. An ability is a description of an action: name, input and output schemas, permissions, hints about behavior. An ability can be called from PHP, through REST and through MCP.
WordPress core, the theme and plugins. Each under its own namespace, so the owner is visible: core/…, forwp-seo-helper/….
No. The agent sees only what was opened for MCP, and only if the user it works on behalf of has the permissions. How to set this up: modules 5–7.