create_shop_report
Generate Shop-Script reports for Webasyst e-commerce projects by specifying report keys, titles, and paths to automate documentation and analytics.
Instructions
Создать отчет Shop-Script
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report_key | Yes | ||
| report_title | Yes | ||
| webasyst_path | Yes |
Implementation Reference
- webasyst-mcp.js:922-941 (handler)The handler function that creates a new ShopScript report PHP class file in wa-apps/shop/lib/reports/ with a basic template extending shopReports.async function createShopReportTool({ report_key, report_title, webasyst_path }) { const reportsDir = path.join(webasyst_path, 'wa-apps', 'shop', 'lib', 'reports'); await ensureDir(reportsDir); const file = path.join(reportsDir, `${toCamelCase(report_key)}.report.php`); const code = `<?php class shop${toCamelCase(report_key)}Report extends shopReports { public function getData(\$start, \$end) { // TODO: implement report logic return array( 'revenue' => 0, 'orders' => 0 ); } } `; await fs.writeFile(file, code); return { content: [{ type: 'text', text: `Report "${report_title}" создан: ${file}` }] }; }
- webasyst-mcp.js:1727-1727 (schema)The input schema definition for the create_shop_report tool, specifying parameters report_key, report_title, and webasyst_path.{ name: 'create_shop_report', description: 'Создать отчет Shop-Script', inputSchema: { type: 'object', properties: { report_key: { type: 'string' }, report_title: { type: 'string' }, webasyst_path: { type: 'string' } }, required: ['report_key', 'report_title', 'webasyst_path'] } },
- webasyst-mcp.js:1789-1789 (registration)Registers the createShopReportTool as the handler for the 'create_shop_report' tool name in the CallToolRequestSchema switch statement.case 'create_shop_report': return await createShopReportTool(args);