dhis2_configure_app_manifest
Generate or update the manifest.webapp file for a DHIS2 application by providing app details such as name, version, developer, activities, and required authorities.
Instructions
Generate or update manifest.webapp file for DHIS2 app
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activities | Yes | ||
| appType | No | Type of DHIS2 application | |
| authorities | No | Required DHIS2 authorities/permissions | |
| description | Yes | App description | |
| developer | Yes | ||
| icons | No | ||
| launch_path | No | Launch path for the app | |
| name | Yes | App name | |
| version | Yes | App version (e.g., "1.0.0") |
Implementation Reference
- src/index.ts:973-983 (handler)The main tool handler in the MCP server's request handler switch statement. It receives arguments, calls generateManifestContent, and returns the generated markdown content as tool response.case 'dhis2_configure_app_manifest': const manifestArgs = args as any; const manifestContent = generateManifestContent(manifestArgs); return { content: [ { type: 'text', text: manifestContent, }, ], };
- src/webapp-generators.ts:144-195 (helper)Core helper function that generates the DHIS2 app manifest content and installation instructions based on input arguments. This is the main logic executed by the tool handler.export function generateManifestContent(args: any): string { const { name, version, description, developer, icons, activities, authorities, appType, launch_path } = args; const manifest = { version: version || '1.0.0', name: name, description: description, developer: { name: developer.name, ...(developer.email && { email: developer.email }) }, icons: icons || { "48": "./icon-48.png", "128": "./icon-128.png" }, activities: activities, ...(authorities && { authorities }), ...(appType && { appType }), ...(launch_path && { launch_path }) }; return `# DHIS2 App Manifest Configuration ## Generated manifest.webapp \`\`\`json ${JSON.stringify(manifest, null, 2)} \`\`\` ## Installation Instructions 1. Save the above content as \`public/manifest.webapp\` in your app directory 2. Ensure icon files exist at the specified paths 3. Update authorities array with required permissions 4. Customize the launch_path if needed ## Authority Examples \`\`\`json "authorities": [ "F_METADATA_IMPORT", "F_METADATA_EXPORT", "F_DATA_VALUE_ADD", "F_DATAVALUE_ADD_WITHIN_ASSIGNED_ORGUNIT", "F_TRACKED_ENTITY_INSTANCE_ADD", "F_PROGRAM_ENROLLMENT" ] \`\`\` ## App Type Options - **APP**: Standard DHIS2 application - **DASHBOARD_WIDGET**: Dashboard plugin/widget - **TRACKER_DASHBOARD_WIDGET**: Tracker-specific dashboard widget `; }
- src/permission-system.ts:134-134 (registration)Permission registration mapping the tool to the 'canConfigureApps' permission in the TOOL_PERMISSIONS Map used for filtering tools based on user permissions.['dhis2_configure_app_manifest', 'canConfigureApps'],
- src/index.ts:104-111 (registration)The ListToolsRequest handler that filters and returns available tools, including this one if permissions allow, using PermissionSystem.filterToolsByPermissions.server.setRequestHandler(ListToolsRequestSchema, async () => { // Filter tools based on user permissions const filteredTools = PermissionSystem.filterToolsByPermissions(tools, userPermissions); return { tools: filteredTools, }; });