Skip to main content
Glama

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
NameRequiredDescriptionDefault
app_idYesID приложения

Implementation Reference

  • 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) }] };
  • 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'] } },
  • Handler registration in the CallToolRequest switch statement, mapping the tool call to the getAppInfoTool function.
    case 'get_app_info': return await getAppInfoTool(args);
  • 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'] } },
  • 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; }

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