Skip to content

Conversation

@crodriguezbrito
Copy link
Contributor

Proposed changes

This PR fix a fatal error if the tools don't return an array on execute_callback.

[ERROR] Error calling tool | Context: {"tool":"blu-add-cpt","exception":"WP\MCP\Handlers\Tools\ToolsHandler::handle_tool_call(): Return value must be of type array, WP_Post returned"}

The callback result is now encapsulated in an array. This, along with replacing WP_Error objects with a standard array format ("message" => "problem description"), prevents the following error.

[ERROR] Error calling tool | Context: {"tool":"blu-get-cpt","exception":"WP\MCP\Handlers\Tools\ToolsHandler::handle_tool_call(): Return value must be of type array, WP_Error returned"} | User ID: 1

Also this PR add the reassign parameter as required for the "blu/delete-user" ability.

Jira task

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@crodriguezbrito crodriguezbrito requested review from circlecube and Copilot and removed request for Copilot November 4, 2025 16:06
@wpscholar wpscholar merged commit 7ac0181 into main Nov 10, 2025
6 checks passed
@wpscholar wpscholar deleted the fix/PRESS0-3489 branch November 10, 2025 18:00
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.

5 participants