Create Drush command for listing, searching and running tools
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3575927. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !80 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>One thing that is becoming clearer and clearer is that code agents will play a bigger and bigger role in development going forward.</p> <p>Having the Tools available via CLI is important for two reasons:</p> <ul> <li>A lot of proof is pointing to coding agents being able to work better with CLI tools, then MCP. See <a href="https://block.github.io/goose/docs/tutorials/playwright-skill/">1</a>, <a href="https://testcollab.com/blog/playwright-cli">2</a>, <a href="https://jannikreinhard.com/2026/02/22/why-cli-tools-are-beating-mcp-for-ai-agents">3</a>.</li> <li>When writing tools, a CLI runner would make it testable without having to run a browser or writing execution code.</li> </ul> <p>Outside of this, there is surely a need for developers to also be able to list, search, inform and execute tools via the CLI.</p> <p>So we need a Drush command. Initially this will be run as user 1, to make sure that any tools permissions are bypassed. </p> <p>For humans this is safe, since if you have access to run Drush you are already on a heightened permission level and can cause enormous harm to the site.</p> <p>This is of course not optimal for coding agents, where we might want a specific Claude Code subagent to only be able to access and run a subset of tools. For this we could later create something like a toolset, which is connected to a specific user and a specific amount of tools, and that requries a hash to always be given as a parameter when running the command. That way its possible to wrap python code around it, to have a similar safe way to running tools as via MCP.</p> <p>We need four commands optimally:</p> <ul> <li>List Tools - this list tools and should have parameters for filtering based on tool operation and have table list format by default for humans and a parameter for markdown output for AI.</li> <li>Search Tools - this should search tool title, description, input definitions via OR operator and also be able to filer based on tool operation and also have table format by default for humans and a parameter for markdown output for AI.</li> <li>Get Tool Info - this should take the tool id and give back all information that is currently in the Tool attribute, which includes information on how to fill in the input.</li> <li>Execute Tool - this should be able to take the tool id and input and execute the tool and show the output of the execution or any possible exceptions.</li> </ul> <p>Later we might want to be able to use the refiners on the Get Tool Info somehow as well, to get a more refined version of the information based on known values.</p> <h3>Proposed Resolution</h3> <ul> <li>Create a list tools drush command under tool namespace.</li> <li>Create a search tools drush command under tool namespace.</li> <li>Create a get tool info drush command under tool namespace.</li> <li>Create an execute tool command under tool namespace.</li> </ul>
issue