get_app_info
Retrieve detailed information about a specific Webasyst framework application by providing its app ID, enabling developers to access app configurations and properties for project management.
Instructions
Получить информацию о конкретном приложении
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ID приложения |
Implementation Reference
- webasyst-mcp.js:92-98 (handler)The core handler function for the 'get_app_info' tool. It locates the Webasyst root directory, finds the specified app's config file (lib/config/app.php), parses its PHP array content, and returns structured app information including path.async function getAppInfoTool({ app_id }) { const rootPath = await findWebasystRoot(); const appPath = path.join(rootPath, 'wa-apps', app_id); const configPath = path.join(appPath, 'lib', 'config', 'app.php'); if (!(await fileExists(configPath))) throw new Error(`Приложение ${app_id} не найдено`); const appInfo = await readPHPConfigArray(configPath).catch(() => ({})); return { content: [{ type: 'text', text: JSON.stringify({ id: app_id, ...appInfo, path: appPath }, null, 2) }] };
- webasyst-mcp.js:1700-1700 (registration)Registration of the 'get_app_info' tool in the ListToolsRequest handler. Defines the tool name, description, and input schema (requiring 'app_id' string).{ name: 'list_app_plugins', description: 'Получить список плагинов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } },
- webasyst-mcp.js:1761-1761 (registration)Handler registration in the CallToolRequest switch statement, mapping the tool call to the getAppInfoTool function.case 'get_app_info': return await getAppInfoTool(args);
- webasyst-mcp.js:1700-1700 (schema)Input schema definition for the tool: expects an object with required 'app_id' property of type string.{ name: 'list_app_plugins', description: 'Получить список плагинов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } },
- webasyst-mcp.js:48-75 (helper)Helper function to parse PHP config files returning associative arrays, extracting string, boolean, and numeric key-value pairs using regex.async function readPHPConfigArray(phpFilePath) { const content = await fs.readFile(phpFilePath, 'utf-8'); const match = content.match(/return\s+(array\s*\([\s\S]*?\)|\[[\s\S]*?\]);/); if (!match) return {}; const body = match[1]; const result = {}; // Parse string values: 'key' => 'value' const stringPairs = body.matchAll(/'([^']+)'\s*=>\s*'([^']*)'/g); for (const m of stringPairs) { result[m[1]] = m[2]; } // Parse boolean values: 'key' => true/false const boolPairs = body.matchAll(/'([^']+)'\s*=>\s*(true|false)/gi); for (const m of boolPairs) { result[m[1]] = m[2].toLowerCase() === 'true'; } // Parse numeric values: 'key' => 123 const numPairs = body.matchAll(/'([^']+)'\s*=>\s*(\d+)/g); for (const m of numPairs) { result[m[1]] = parseInt(m[2], 10); } return result; }