create_site_block
Create a Site constructor block in Webasyst by specifying block name, title, category, and project path.
Instructions
Создать блок конструктора Site
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_name | Yes | ||
| block_title | Yes | ||
| block_category | No | ||
| webasyst_path | Yes |
Implementation Reference
- webasyst-mcp.js:685-691 (handler)The core handler function implementing the 'create_site_block' tool. It creates the block directory in wa-apps/site/blocks/, generates block.php with name and category, and block.html template.async function createSiteBlockTool({ block_name, block_title, block_category = 'content', webasyst_path }) { const blockPath = path.join(webasyst_path, 'wa-apps', 'site', 'blocks', block_name); await ensureDir(blockPath); await fs.writeFile(path.join(blockPath, 'block.php'), `<?php\nreturn array(\n 'name' => '${block_title}',\n 'category' => '${block_category}'\n);\n`); await fs.writeFile(path.join(blockPath, 'block.html'), `{* ${block_title} *}\n<div class="block-${block_name}">\n <!-- Block content -->\n</div>\n`); return { content: [{ type: 'text', text: `Блок "${block_title}" создан: ${blockPath}` }] }; }
- webasyst-mcp.js:1719-1719 (schema)Input schema and metadata for the 'create_site_block' tool, defining parameters: block_name, block_title, block_category (optional), webasyst_path (required). Part of ListToolsRequestHandler response.{ name: 'create_site_block', description: 'Создать блок конструктора Site', inputSchema: { type: 'object', properties: { block_name: { type: 'string' }, block_title: { type: 'string' }, block_category: { type: 'string' }, webasyst_path: { type: 'string' } }, required: ['block_name', 'block_title', 'webasyst_path'] } },
- webasyst-mcp.js:1781-1781 (registration)Registration of the tool handler in the CallToolRequestHandler switch statement, mapping tool name to createSiteBlockTool execution.case 'create_site_block': return await createSiteBlockTool(args);