Skip to main content
Glama

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
NameRequiredDescriptionDefault
block_nameYes
block_titleYes
block_categoryNo
webasyst_pathYes

Implementation Reference

  • 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}` }] }; }
  • 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'] } },
  • Registration of the tool handler in the CallToolRequestHandler switch statement, mapping tool name to createSiteBlockTool execution.
    case 'create_site_block': return await createSiteBlockTool(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emmy-design/webasyst-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server