Tools UI overview page does not load
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3579979. -->
Reported by: [scott_euser](https://www.drupal.org/user/3267594)
Related to !1443 !1329
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>[One-line issue summary for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>If you enable AI mode + Tools module + MCP without making other changes, then /admin/config/ai/tools leads to </p>
<pre>The website encountered an unexpected error. Try again later.<br><br>InvalidArgumentException: The opener ID parameter is required and must be a string. in Drupal\ai\AiToolsLibraryState->validateRequiredParameters() (line 131 of modules/contrib/ai/src/AiToolsLibraryState.php).<br>Drupal\ai\AiToolsLibraryState->__construct() (Line: 68)<br>Drupal\ai\AiToolsLibraryState::create() (Line: 94)<br>Drupal\ai\AiToolsLibraryState::fromRequest() (Line: 83)<br>Drupal\ai\Service\AiToolsLibraryUiBuilder->buildUi() (Line: 37)<br>Drupal\ai\Controller\ToolsLibrary->overview()</pre><h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>See above</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>I am not quite sure what the intention is; it looks like ::buildUi() calls AiToolsLibraryState::fromRequest() and that seems to assume that these query string variables are available (but they aren't if you just go to that URL):</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> $state </span><span style="color: #007700">= static::</span><span style="color: #0000BB">create</span><span style="color: #007700">(<br> </span><span style="color: #0000BB">$query</span><span style="color: #007700">-></span><span style="color: #0000BB">get</span><span style="color: #007700">(</span><span style="color: #DD0000">'ai_tools_library_opener_id'</span><span style="color: #007700">),<br> </span><span style="color: #0000BB">$query</span><span style="color: #007700">-></span><span style="color: #0000BB">all</span><span style="color: #007700">(</span><span style="color: #DD0000">'ai_tools_library_allowed_groups'</span><span style="color: #007700">),<br> </span><span style="color: #0000BB">$query</span><span style="color: #007700">-></span><span style="color: #0000BB">get</span><span style="color: #007700">(</span><span style="color: #DD0000">'ai_tools_library_selected_group'</span><span style="color: #007700">),<br> </span><span style="color: #0000BB">$query</span><span style="color: #007700">-></span><span style="color: #0000BB">all</span><span style="color: #007700">(</span><span style="color: #DD0000">'ai_tools_library_opener_parameters'</span><span style="color: #007700">)<br> );<br></span><span style="color: #0000BB">?></span></span></pre></div>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>TBD</p>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
<p>TBD</p>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[ ] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br>
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p>
<p>[ ] AI Generated Code<br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
<p>[ ] Vibe Coded<br>
This code was generated by an AI and has only been functionally tested.</p>
issue