Add limits on how often a tool can run
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3547995. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !224
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Right now we have to tell the system prompt how often it is allowed to use a specific tool. But there should also be a determenistic way, where if the tool gets stuck in a loop or searches to no awail in a RAG database for instance, we need to be able to programatically say how many times a tool can run.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a form value of how many times a tool can run.</li>
<li>Add a form for setting the error message when this happens.</li>
<li>If the tool has run that many times, prevent the execution and present the error message as the result.</li>
</ul>
issue