- Issue created by @marcus_johansson
- 🇬🇧United Kingdom MrDaleSmith
TBH I would advise against this: plugins are the Drupal way of doing this and allowing code to be discovered and used by any module that wants to. That you find the system complicated is more of an issue with Drupal than it is with the AI module, and anything you do to "improve" it will be non-standard and therefore confusing to people who are familiar with Drupal.
I think if you wanted to, a decent compromise would be to have an implementation of the existing plugins that could discover your simplified tools and run them. Otherwise you risk redesigning Drupal from inside contrib and causing unintended issues everywhere.
- 🇦🇹Austria roromedia Linz
Maybe a bit off topic: From an end-user experience it would be great to have tools which are exposed through a GUI tool browser which would enable non-coders to download pre-made tools similar to the project browser. In an ideal world you could just download the multiplicator tool and enable it through an interface similar to the "Extend" feature for modules.
My view on this is: If you are able to code a bit - or at least able to code together with an AI-tool you should be able to use a scaffolding code to whip up a simple tool any way - even the Drupal way looks a bit more intimidating than the Python or JS counterparts. For non-coders the GUI-approach would open a whole new world of functionality to them. - 🇧🇬Bulgaria valthebald Sofia
PHP port of python MCP SDK https://packagist.org/packages/logiscape/mcp-sdk-php allows something similar:
https://github.com/logiscape/mcp-sdk-php/blob/5885e4cad09eae9662f9c8e3b7...
// Create schema with properties and required fields $inputSchema = new ToolInputSchema( properties: $properties, required: ['num1', 'num2'] ); // Create calculator tool $calculator = new Tool( name: 'add-numbers', description: 'Adds two numbers together', inputSchema: $inputSchema ); $server->registerHandler('tools/call', function($params) { $name = $params->name; switch ($name) { case 'add-numbers': ...
- 🇧🇬Bulgaria valthebald Sofia
I was thinking... can we combine the best of 2 worlds?
How hard would it be to create a form for dynamically creating a tool as a Drupal plugin?
Conceptually, this could be similar to what XB does with the option to create a component on the fly, only much-much simpler.
The form in question could contain a dynamic list of parameters (name/type/description) + the body field
The body could include PHP code (simple but potentially dangerous option) or some form of pseudo code - twig/ECA model