Skip to main content
Glama

create_shop_theme

Create custom Shop-Script themes for Webasyst framework projects by defining theme names, titles, styles, and color schemes to customize storefront appearance.

Instructions

Создать тему Shop-Script

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
theme_nameYes
theme_titleYes
style_typeNo
color_schemeNo
webasyst_pathYes

Implementation Reference

  • The core handler function that creates a new Shop-Script theme. It sets up the directory wa-apps/shop/themes/{theme_name}, generates theme.xml with metadata, a basic theme.css with CSS variables, and an index.html template extending default.html.
    async function createShopThemeTool({ theme_name, theme_title, style_type = 'modern', color_scheme = {}, webasyst_path }) { const t = path.join(webasyst_path, 'wa-apps', 'shop', 'themes', theme_name); await ensureDir(t); await fs.writeFile(path.join(t, 'theme.xml'), `<?xml version="1.0" encoding="UTF-8"?>\n<theme id="${theme_name}" app="shop" version="1.0.0">\n <name locale="en_US">${theme_title}</name>\n <name locale="ru_RU">${theme_title}</name>\n <description locale="en_US">${theme_title} theme</description>\n <description locale="ru_RU">Тема ${theme_title}</description>\n</theme>\n`); await fs.writeFile(path.join(t, 'theme.css'), `:root { --primary: ${color_scheme.primary || 'var(--accent-color)'}; }\n`); await fs.writeFile(path.join(t, 'index.html'), `{extends file="default.html"}\n{block name="content"}\n<h1>${theme_title}</h1>\n{/block}\n`); return { content: [{ type: 'text', text: `Shop theme "${theme_title}" создана: ${t}` }] }; }
  • Registration in the CallToolRequestSchema handler's switch statement that maps the tool name to the createShopThemeTool function.
    case 'create_shop_theme': return await createShopThemeTool(args);
  • Tool registration in the ListToolsRequestSchema response, including name, description, and input schema definition.
    { name: 'create_shop_theme', description: 'Создать тему Shop-Script', inputSchema: { type: 'object', properties: { theme_name: { type: 'string' }, theme_title: { type: 'string' }, style_type: { type: 'string' }, color_scheme: { type: 'object' }, webasyst_path: { type: 'string' } }, required: ['theme_name', 'theme_title', 'webasyst_path'] } }, { name: 'create_shipping_plugin', description: 'Создать плагин доставки (wa-plugins/shipping/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_payment_plugin', description: 'Создать плагин оплаты (wa-plugins/payment/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } },
  • Input schema definition for the create_shop_theme tool, specifying parameters like theme_name, theme_title, webasyst_path as required.
    { name: 'create_shipping_plugin', description: 'Создать плагин доставки (wa-plugins/shipping/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_payment_plugin', description: 'Создать плагин оплаты (wa-plugins/payment/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } },

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