Problem
The agent can currently read/write workspace and memory, but cannot inspect core WordPress content entities (posts/pages) through dedicated read abilities. This limits useful site-aware assistance.
Current State
- Built-in abilities are registered under
includes/abilities/ and exposed through Abilities_Helper.
- Existing model tool flow already supports paginated/structured outputs and policy checks.
Implementation Plan
1) Add read-only content abilities
Create new built-in abilities under includes/abilities/:
post_list (list posts with filters)
post_read (read a single post/page by ID or slug)
2) Input schema (strict)
For post_list:
post_type (post, page initially)
status (default safe statuses)
search
author
per_page (bounded, e.g. 1-50)
page
orderby, order
For post_read:
- one of
id or slug
- optional
post_type
3) Output schema (model-friendly)
Return concise structured payload:
- id, type, status, slug, title, excerpt, content (optionally truncated), date fields, author info, link.
- Include pagination metadata for list endpoint.
4) Capability and policy
- Use read-level permission callbacks (
current_user_can( 'read' )) plus runtime policy gates in Abilities_Helper.
- Mark as readonly in ability annotations.
5) Register + map
- Register abilities in
includes/class-abilities.php.
- Add tool mapping in
Abilities_Helper::TOOL_TO_ABILITY.
Acceptance Criteria
- Agent can list and read posts/pages via tool calls.
- Inputs are validated and bounded; invalid filters fail gracefully.
- Outputs are deterministic and stable across repeated calls.
- No write/delete behavior introduced.
Test Plan
- Unit tests for ability callbacks:
- list paging/filter behavior,
- read by ID/slug,
- invalid inputs.
- Unit tests for tool declaration registration and mapping.
- Permission tests (denied vs allowed paths).
Out of Scope
- Editing/publishing/deleting content.
- Full taxonomy/media traversal in this first pass.
Problem
The agent can currently read/write workspace and memory, but cannot inspect core WordPress content entities (posts/pages) through dedicated read abilities. This limits useful site-aware assistance.
Current State
includes/abilities/and exposed throughAbilities_Helper.Implementation Plan
1) Add read-only content abilities
Create new built-in abilities under
includes/abilities/:post_list(list posts with filters)post_read(read a single post/page by ID or slug)2) Input schema (strict)
For
post_list:post_type(post,pageinitially)status(default safe statuses)searchauthorper_page(bounded, e.g. 1-50)pageorderby,orderFor
post_read:idorslugpost_type3) Output schema (model-friendly)
Return concise structured payload:
4) Capability and policy
current_user_can( 'read' )) plus runtime policy gates inAbilities_Helper.5) Register + map
includes/class-abilities.php.Abilities_Helper::TOOL_TO_ABILITY.Acceptance Criteria
Test Plan
Out of Scope