The Story Item block registers two WordPress Abilities for AI-assisted title and blurb generation. Both abilities are exposed through REST and as public MCP tools for authenticated consumers.
Ability index
| Ability | Permission | WordPress side effects |
|---|---|---|
prc-ai/generate-blurb | edit_posts, then edit_post for the linked post | None; sends post text to the configured AI provider |
prc-ai/generate-title | edit_posts, then edit_post for the linked post | None; sends post text to the configured AI provider |
Both abilities declare readonly: true, destructive: false, and idempotent: false. They are allowed for prc-block/story-item.
Generate a blurb
prc-ai/generate-blurb creates a concise one- or two-sentence summary from the linked post title and text.
Input
-
post_idnumber required -
Linked post ID.
-
site_idnumber -
Optional multisite blog ID; defaults to the content site.
No fields match this filter.
The output object has:
| Field | Type | Description |
|---|---|---|
error | string | Empty on success; otherwise a validation, permission, content, site, or AI-provider error |
blurb | string | Generated plain text; empty on failure |
Generate a title
prc-ai/generate-title creates a short factual headline from the linked post title and text.
Input
-
post_idnumber required -
Linked post ID.
-
site_idnumber -
Optional multisite blog ID; defaults to the content site.
No fields match this filter.
The output object has:
| Field | Type | Description |
|---|---|---|
error | string | Empty on success; otherwise a validation, permission, content, site, or AI-provider error |
title | string | Generated plain text; empty on failure |
Input and content handling
The abilities prefer the post excerpt. They fall back to post content, remove HTML, normalize whitespace, and limit source text to 15,000 characters. In non-production environments, the prompt normalizes a local permalink to the configured public production origin.
Generation fails when:
post_idis missing or invalid.- The current user cannot edit the linked post.
- The post does not exist.
- The post has no title, excerpt, or body text.
- The target site is invalid or does not have the plugin active.
- The configured AI client or model returns an error.
Registration source
src/story-item/class-story-item.php conditionally registers the feature with the WordPress AI plugin. src/story-item/class-ai.php defines both abilities, their schemas, permissions, prompts, and output handling.