Skip to content

feat(abilities): add related posts ability#5

Merged
rbcorrales merged 2 commits into
mainfrom
feat/find-related-ability
May 27, 2026
Merged

feat(abilities): add related posts ability#5
rbcorrales merged 2 commits into
mainfrom
feat/find-related-ability

Conversation

@rbcorrales
Copy link
Copy Markdown
Member

Summary

  1. Registers wpvdb/find-related-posts as a read only MCP public Ability.
  2. Wraps Search::related_to_post() and returns agent safe related post results with canonical URLs.
  3. Documents the Ability and MCP usage, refreshes translations, and adds unit coverage.

Test steps

  1. Deploy wpvdb-search to a test site with MCP Adapter active.
  2. Initialize the MCP endpoint and call mcp-adapter-discover-abilities. Confirm wpvdb/semantic-search and wpvdb/find-related-posts appear.
  3. Call mcp-adapter-execute-ability with ability_name set to wpvdb/find-related-posts and a source post_id. Confirm the response has mode set to related and returns related results.

Co-Authored-By: Codex <codex@openai.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a second public Abilities/MCP tool wpvdb/find-related-posts that wraps Search::related_to_post(), returning the same agent-safe result projection as the existing semantic search ability. Includes input/output schemas, README + POT/PO updates, and new unit coverage along with bootstrap stubs needed to exercise the abilities layer.

Changes:

  • Register wpvdb/find-related-posts ability with input/output schemas and reuse format_results() for agent-safe output.
  • Expand README and translation catalogs to document the new ability.
  • Add AbilitiesTest plus Abilities/API/user/transient stubs in the test bootstrap.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
includes/class-abilities.php Adds FIND_RELATED constant, registration, executor, and input/output schemas for related-post lookup.
README.md Documents the new ability and its REST route alongside semantic search.
languages/wpvdb-search.pot New translatable strings for the related ability.
languages/wpvdb-search-es_ES.po Spanish translations (several marked fuzzy) for the related ability strings.
tests/Unit/AbilitiesTest.php New tests covering ability registration and related execution paths.
tests/bootstrap.php Adds stubs (add_action, caps, transients, wp_register_ability*, get_post_type_object) and loads the abilities class.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/class-abilities.php Outdated
Co-Authored-By: Codex <codex@openai.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@rbcorrales rbcorrales merged commit 5a5e184 into main May 27, 2026
3 checks passed
@rbcorrales rbcorrales deleted the feat/find-related-ability branch May 27, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants