PHP code example of mage2kishan / magento2-claude-ai
1. Go to this page and download the library: Download mage2kishan/magento2-claude-ai library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mage2kishan / magento2-claude-ai example snippets
namespace YourVendor\YourModule\Model\Tool;
use Panth\ClaudeAi\Model\Tool\ToolInterface;
class MyTool implements ToolInterface
{
public function name(): string { return 'my_tool'; }
public function definition(): array
{
return [
'name' => 'my_tool',
'description' => 'Be specific — the AI uses this to decide when to call you.',
'input_schema' => [
'type' => 'object',
'properties' => [
'param' => ['type' => 'string', 'description' => 'A parameter'],
],
'