Skip to main content
Glama

list_app_widgets

Retrieve a list of widgets for a specific Webasyst application by providing its app ID. Use this tool to view available widgets when configuring or developing apps.

Instructions

Получить список виджетов приложения

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYesID приложения

Implementation Reference

  • Handler function that lists widgets for the given app_id by scanning the widgets directory and parsing widget.php config files.
    async function listAppWidgetsTool({ app_id }) { const rootPath = await findWebasystRoot(); const widgetsPath = path.join(rootPath, 'wa-apps', app_id, 'widgets'); if (!(await fileExists(widgetsPath))) return { content: [{ type: 'text', text: `У приложения ${app_id} нет виджетов` }] }; const widgets = []; for (const dir of await fs.readdir(widgetsPath)) { const widgetConfig = path.join(widgetsPath, dir, 'lib', 'config', 'widget.php'); if (await fileExists(widgetConfig)) { const info = await readPHPConfigArray(widgetConfig).catch(() => ({})); widgets.push({ id: dir, name: info.name || dir }); } } return { content: [{ type: 'text', text: `Виджеты приложения ${app_id}:\n\n${widgets.map(w => `- ${w.name} (${w.id})`).join('\n')}` }] }; }
  • Input schema for the tool: requires 'app_id' as a string.
    { name: 'list_app_widgets', description: 'Получить список виджетов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'get_routing_config', description: 'Получить конфигурацию маршрутизации', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения (опционально)' } } } },
  • Registration of the tool handler in the CallToolRequestSchema switch statement.
    case 'list_app_widgets': return await listAppWidgetsTool(args);
  • Tool registration in the ListToolsRequestSchema response, including name, description, and schema.
    { name: 'list_app_widgets', description: 'Получить список виджетов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'get_routing_config', description: 'Получить конфигурацию маршрутизации', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения (опционально)' } } } },

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