Function calls have silent dependencies
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3515456. -->
Reported by: [andrewbelcher](https://www.drupal.org/user/655282)
Related to !67
>>>
<p>Depends on <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3512526" title="Status: Closed (fixed)">#3512526: AI Core: Add module dependencies to tools</a></span></p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Currently, AI Agents includes a few agents that have dependencies on other modules that are not core dependencies of AI Agents (or it's dependants). This means there are agents that make use of services, classes, or entity types that are not available.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Install AI Agents on a site that doesn't have node enabled. Try the Node Content Type Agent in the API explorer, you get a fatal error:</p>
<pre>Error: Class "Drupal\node\Entity\NodeType" not found in Drupal\ai_agents\Plugin\AiAgent\ContentType->getNodeTypes() (line 489 of /var/www/html/docroot/modules/contrib/ai_agents/src/Plugin/AiAgent/ContentType.php).</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Once <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3512526" title="Status: Closed (fixed)">#3512526: AI Core: Add module dependencies to tools</a></span> has been implemented, we should update the function calls to declare their dependencies.</p>
> Related issue: [Issue #3515454](https://www.drupal.org/node/3515454)
issue