Create a getDefinitions version that can filter on tool id or tools interfaces being used.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3529540. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>There will be applications that wants to use only agents that output specific tools to get structured output from them. </p>
<p>Think for instance of an agent that does FieldValidation, we might have a FieldValidationToolInterface that has to have a method that is validationResult and a method that is validationReasoning. Or a tool with those methods.</p>
<p>Any agent that would use this tool could work as a field validation agent.</p>
<p>When you setup the field validation rule for this, you only want to show agents that are utilizing this tool or toolinterface, and no other agents.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>On the plugin manager for loading agents create a public method for getting definitions of config AI Agents that are either using a specific tool id or that are using tools of a specific interface. The method can use class_exists to know what it is dealing with and have one unified string input.</li>
<li>Come up with a good name for the method :)</li>
<li>Use the normal getDefinitions and filter out and config agent and then filter on the tool or method wanted.</li>
</ul>
issue