You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 227c7a5
Browse filesBrowse the repository at this point in the historyBrowse files
Abilities: Mark abilities as public with the meta.public flag (#55104)
* Abilities: Mark abilities as public with the meta.public flag
- Add meta.public to all 35 abilities; keep show_in_rest and meta.mcp
- Require the flag in every ability test
- Update the ship-wp-ability skill, templates and docs, plus changelogs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Abilities: Mark Social abilities as public with the meta.public flag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .agents/skills/ship-wp-ability.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,8 +119,9 @@ For every entry in `get_abilities()`:
119
119
-`execute_callback` — `[ __CLASS__, 'method_name' ]`. Method signature is `( $input = null )`. Return value is a plain array (or `WP_Error`). Keep the shape **high-signal** — don't return raw `$mod` / `WP_Post` / option dumps; summarize. See the anti-patterns section of `references/agent-ergonomics.md`.
120
120
-`permission_callback` — `[ __CLASS__, 'can_method' ]`. See the permissions table below.
121
121
-`meta.annotations` — `readonly`, `destructive`, `idempotent` booleans. These must match execute behavior; `wp-abilities-verify` will flag mismatches.
122
-
-`meta.mcp` — every ability gets `'mcp' => array( 'public' => true, 'type' => 'tool' )`. This is what surfaces the ability to MCP-bridged AI agents as a tool. Matches the convention used by Stats / Boost / Modules abilities; leaving it off makes the ability invisible to MCP consumers even though it shows up in `/wp-abilities/v1/abilities/`. Flip `public => false` only when the ability is for internal callers and explicitly shouldn't be agent-discoverable.
123
-
-`meta.show_in_rest` — `true` when the ability should be callable via REST.
122
+
-`meta.public` — `true` for every agent-facing ability. This is the WordPress-level flag that marks an ability as available to clients. MCP adapter 0.6.0+ falls back to it when `meta.mcp.public` is not set, and WordPress 7.1+ uses it as the default for `show_in_rest`.
123
+
-`meta.show_in_rest` — keep `true` explicit. WordPress 7.0 does not derive it from `meta.public`, so leaving it out hides the ability from `/wp-abilities/v1/abilities/` there.
124
+
-`meta.mcp` — every ability also gets `'mcp' => array( 'public' => true, 'type' => 'tool' )`. MCP adapters older than 0.6.0 read only `meta.mcp.public`, so keep it alongside `meta.public`. For an ability meant only for internal callers, set both `meta.public` and `meta.mcp.public` to `false`: an explicit `meta.mcp.public` overrides `meta.public` for MCP. Also set `show_in_rest` to `false` unless those callers need REST, because an explicit `true` keeps the ability in `/wp-abilities/v1/abilities/` and in WordPress.com's remote ability discovery. Leave that slug out of the public-flag test in `references/test-templates.md`.
124
125
-**Do NOT set `category`** in the spec. `Registrar` auto-injects it. Setting it duplicates info that drifts.
125
126
-`WP_Error` codes — use the shared vocabulary in `wp-abilities-api/references/error-code-vocabulary.md` (`<plugin>_not_initialized`, `<plugin>_missing_<field>`, `<plugin>_invalid_<field>`, `<plugin>_<resource>_data_unavailable`). The **message** should tell the agent *what to do next* — e.g. "Unknown module slug. Call jetpack-modules/get-modules to enumerate." — not just restate the error condition.
126
127
-**Pagination** — any list-shaped read needs `page`/`per_page` (or `limit`/`cursor`) with a `default` of ~20 and a `maximum` of ~100. Enforce the max in the callback. Even if today's dataset is small, don't ship ability specs that return unbounded lists.
Copy file name to clipboardExpand all lines: projects/packages/connection/docs/abilities.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ A read-only, idempotent ability that is safe to poll. It takes no input and retu
29
29
30
30
**Permissions:** Access is gated on `current_user_can( 'jetpack_admin_page' )`, mirroring the capability used by the Jetpack admin page.
31
31
32
-
**MCP:** This ability is opted into the MCP tool surface (`meta.mcp.public = true`), so it is exposed as a public MCP tool.
32
+
**MCP:** This ability is marked public (`meta.public = true`) and keeps the MCP opt-in (`meta.mcp.public = true`) for older MCP adapters, so it is exposed as a public MCP tool.
0 commit comments