Skip to main content
Glama

dhis2_generate_app_runtime_config

Generate integration configuration for DHIS2 App Runtime. Specify app name, API version, and features like data query, offline capabilities, and PWA to streamline app development.

Instructions

Generate configuration for DHIS2 App Runtime integration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiVersionNoDHIS2 API version to target (e.g., 40 for 2.40)
appNameYesName of the application
errorBoundaryNoInclude error boundary component
featuresNo
loadingMaskNoInclude loading mask component

Implementation Reference

  • The main handler function that generates DHIS2 App Runtime configuration code snippets, including DataProvider setup, query/mutation examples, alerts, offline config, etc. This is the core logic executed when the tool is called.
    export function generateAppRuntimeConfig(args: any): string { const { apiVersion = 40, appName, features = {}, errorBoundary = true, loadingMask = true } = args; return `# DHIS2 App Runtime Configuration ## Provider Setup \`\`\`jsx import { DataProvider } from '@dhis2/app-runtime'; import { CssReset } from '@dhis2/ui'; const config = { baseUrl: process.env.REACT_APP_DHIS2_BASE_URL, apiVersion: ${apiVersion} }; function App() { return ( <DataProvider config={config}> <CssReset /> ${errorBoundary ? '<ErrorBoundary>' : ''} ${loadingMask ? '<LoadingMask>' : ''} <${appName}App /> ${loadingMask ? '</LoadingMask>' : ''} ${errorBoundary ? '</ErrorBoundary>' : ''} </DataProvider> ); } \`\`\` ${features.dataQuery ? generateDataQueryExamples() : ''} ${features.dataMutation ? generateDataMutationExamples() : ''} ${features.alerts ? generateAlertsExample() : ''} ${features.offline ? generateOfflineExample() : ''} ${features.pwa ? generatePWAExample() : ''} ## Configuration Options \`\`\`javascript const config = { baseUrl: 'https://your-dhis2-instance.com', apiVersion: ${apiVersion}, timeout: 30000, retries: 3, headers: { 'X-Requested-With': 'XMLHttpRequest' } }; \`\`\` `;
  • src/index.ts:1009-1019 (registration)
    The tool dispatch/registration in the main server request handler. Maps the tool name to the generateAppRuntimeConfig function call and formats the response.
    case 'dhis2_generate_app_runtime_config': const runtimeConfigArgs = args as any; const runtimeConfig = generateAppRuntimeConfig(runtimeConfigArgs); return { content: [ { type: 'text', text: runtimeConfig, }, ], };
  • Permission mapping for the tool in TOOL_PERMISSIONS Map. Requires 'canConfigureApps' permission to execute.
    ['dhis2_generate_app_runtime_config', 'canConfigureApps'],

Other Tools

Related Tools

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/Dradebo/dhis2-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server