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
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ID приложения |
Implementation Reference
- webasyst-mcp.js:137-150 (handler)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')}` }] }; }
- webasyst-mcp.js:1703-1704 (schema)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 приложения (опционально)' } } } },
- webasyst-mcp.js:1765-1765 (registration)Registration of the tool handler in the CallToolRequestSchema switch statement.case 'list_app_widgets': return await listAppWidgetsTool(args);
- webasyst-mcp.js:1703-1704 (registration)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 приложения (опционально)' } } } },