Skip to main content
Glama

create_site_theme

Create custom themes for Webasyst sites by defining style types, color schemes, layout features, and responsive options to match specific design requirements.

Instructions

Создать тему для Site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
theme_nameYes
theme_titleYes
style_typeNo
color_schemeNo
layout_featuresNo
responsive_breakpointsNo
dark_modeNo
rtl_supportNo
webasyst_pathYes

Implementation Reference

  • The core handler function that creates a new Site theme. It generates the theme directory, writes theme.xml with metadata, a basic theme.css with CSS variables, and an index.html template.
    async function createSiteThemeTool({ theme_name, theme_title, style_type = 'modern', color_scheme = {}, layout_features = [], responsive_breakpoints = true, dark_mode = false, rtl_support = false, webasyst_path }) { const t = path.join(webasyst_path, 'wa-apps', 'site', 'themes', theme_name); await ensureDir(t); const xml = `<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE theme PUBLIC "wa-app-theme" "http://www.webasyst.com/wa-content/xml/wa-app-theme.dtd"> <theme id="${theme_name}" system="0" vendor="custom" app="site" version="1.0.0"> <name locale="en_US">${theme_title}</name> <name locale="ru_RU">${theme_title}</name> <description locale="en_US">${theme_title} theme</description> <description locale="ru_RU">Тема ${theme_title}</description> </theme> `; await fs.writeFile(path.join(t, 'theme.xml'), xml); await fs.writeFile(path.join(t, 'theme.css'), `:root {\n --primary: ${color_scheme.primary || 'var(--accent-color)'};\n}\n`); await fs.writeFile(path.join(t, 'index.html'), `{* ${theme_title} *}\n<!DOCTYPE html>\n<html>\n<head>\n <title>{\$wa->title()}</title>\n <link rel="stylesheet" href="{\$wa_theme_url}theme.css">\n</head>\n<body>\n <div class="site-theme">${theme_title}</div>\n</body>\n</html>\n`); return { content: [{ type: 'text', text: `Тема "${theme_title}" создана: ${t}` }] };
  • Registration of the 'create_site_theme' tool in the MCP server's request handler switch statement, mapping the tool name to its handler function.
    case 'create_site_theme': return await createSiteThemeTool(args);
  • Tool schema definition including input parameters for theme creation (name, title, styling options, path) as listed in the server's tool list response.
    { name: 'create_site_theme', description: 'Создать тему для Site', inputSchema: { type: 'object', properties: { theme_name: { type: 'string' }, theme_title: { type: 'string' }, style_type: { type: 'string' }, color_scheme: { type: 'object' }, layout_features: { type: 'array', items: { type: 'string' } }, responsive_breakpoints: { type: 'boolean' }, dark_mode: { type: 'boolean' }, rtl_support: { type: 'boolean' }, webasyst_path: { type: 'string' } }, required: ['theme_name', 'theme_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