queryApplist
Retrieve paginated RPA application lists by filtering with app ID, name, or owner details. Ideal for managing and accessing automation workflows within the YingDao RPA MCP Server.
Instructions
该接口用于分页获取RPA应用列表。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | RPA应用UUID | |
| appName | No | RPA应用名称模糊匹配 | |
| ownerUserSearchKey | No | 用户账号精确匹配 | |
| page | No | 页码 | 1 |
| size | No | 一页大小 | 30 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"appId": {
"description": "RPA应用UUID",
"type": "string"
},
"appName": {
"description": "RPA应用名称模糊匹配",
"type": "string"
},
"ownerUserSearchKey": {
"description": "用户账号精确匹配",
"type": "string"
},
"page": {
"default": "1",
"description": "页码",
"type": "string"
},
"size": {
"default": "30",
"description": "一页大小",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/yingdao/localService.ts:33-66 (handler)Local service handler for queryApplist tool: scans local apps directory for RPA applications matching criteria and returns list.async queryAppList() { const result = []; try { if (!existsSync(this.appsPath)) { return []; } const appFolders = readdirSync(this.appsPath, { withFileTypes: true }) .filter(dirent => dirent.isDirectory() && dirent.name.endsWith('_Release')) .map(dirent => dirent.name); for (const folder of appFolders) { const packageJsonPath = path.join(this.appsPath, folder, 'xbot_robot', 'package.json'); if (existsSync(packageJsonPath)) { try { const packageData = JSON.parse(readFileSync(packageJsonPath, 'utf8')); if (packageData.robot_type === 'app' && packageData.name) { result.push({ uuid: packageData.uuid || '', name: packageData.name, description: packageData.description || '' }); } } catch (err) { console.error(`Error parsing package.json in ${folder}:`, err); } } } return result; } catch (err) { console.error('Error reading apps directory:', err); return []; } }
- src/yingdao/openApiService.ts:26-42 (handler)OpenAPI service handler for queryApplist tool: makes POST request to Yingdao API /app/open/query/list endpoint.async queryAppList(params: { appId?: string; size?: number; page?: number; ownerUserSearchKey?: string; appName?: string; }): Promise<AppListResponse> { try { const response = await this.client.post('/app/open/query/list', params); console.log("response",response.data); return response.data.code === 200 ? response.data.data : response.data.msg ; } catch (error: any) { throw new Error(`Failed to fetch app list: ${error.message}`); } }
- src/baseServer.ts:42-49 (registration)Registration of queryApplist tool using localService in BaseServer.this.server.tool('queryApplist', i18n.t('tool.queryApplist.description'), querySchema, async ({ appId, size, page, ownerUserSearchKey, appName }) => { try { const result = await this.localService?.queryAppList(); return { content: [{ type: 'text', text: JSON.stringify(result) }]}; } catch (error) { throw new Error(i18n.t('tool.queryApplist.error')); } });
- src/baseServer.ts:88-100 (registration)Registration of queryApplist tool using openApiService in BaseServer.this.server.tool('queryApplist', i18n.t('tool.queryApplist.description'), querySchema, async ({ appId, size, page, ownerUserSearchKey, appName }) => { try { const result = await this.openApiService?.queryAppList({ appId, size, page, ownerUserSearchKey, appName }); return { content: [{ type: 'text', text: JSON.stringify(result) }]}; } catch (error) { throw new Error(i18n.t('tool.queryApplist.error')); }
- src/schema/openApi.ts:44-58 (schema)Input schema (querySchema) used for queryApplist tool parameters.export const querySchema = { appId: z.string().optional().describe(i18n.t('schema.query.appId')), size: z.string() .optional() .default('30') .transform(Number) .describe(i18n.t('schema.query.size')), page: z.string() .optional() .default('1') .transform(Number) .describe(i18n.t('schema.query.page')), ownerUserSearchKey: z.string().optional().describe(i18n.t('schema.query.ownerUserSearchKey')), appName: z.string().optional().describe(i18n.t('schema.query.appName')) } as const;