Improve ai_agents module API to simplify tool result handling
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3529310. --> Reported by: [narendrar](https://www.drupal.org/user/1730192) Related to !150 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Current usage of the `ai_agents` module requires manually looping over tool results to find tools by plugin ID or by class. See <a href="https://git.drupalcode.org/project/experience_builder/-/merge_requests/1048#note_521657">https://git.drupalcode.org/project/experience_builder/-/merge_requests/1048#note_521657</a></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Create helper methods such as <code>getToolResultsByPluginId(string $pluginId)</code>, <code>getToolResultsByClass(string $className)</code> to avoid code complexity</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> > Related issue: [Issue #3522013](https://www.drupal.org/node/3522013) > Related issue: [Issue #3529313](https://www.drupal.org/node/3529313)
issue