Skip to main content
Glama

dhis2_generate_app_runtime_config

Generate configuration for DHIS2 App Runtime integration to enable data query hooks, mutation hooks, alerts, offline capabilities, and PWA features for health information system applications.

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
featuresNo
errorBoundaryNoInclude error boundary component
loadingMaskNoInclude loading mask component

Implementation Reference

  • Handler function that generates DHIS2 App Runtime configuration code, including DataProvider setup, configuration options, and optional feature examples (dataQuery, dataMutation, alerts, offline, PWA).
    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)
    MCP tool dispatch/registration in the main server request handler switch statement, calling the generateAppRuntimeConfig handler.
    case 'dhis2_generate_app_runtime_config':
      const runtimeConfigArgs = args as any;
      const runtimeConfig = generateAppRuntimeConfig(runtimeConfigArgs);
      return {
        content: [
          {
            type: 'text',
            text: runtimeConfig,
          },
        ],
      };
  • Permission mapping in TOOL_PERMISSIONS static array, requiring 'canConfigureApps' permission for access.
    ['dhis2_generate_app_runtime_config', 'canConfigureApps'],
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates configuration but doesn't clarify what that entails—whether it creates files, modifies existing ones, requires specific permissions, has side effects, or what the output format is. For a tool with no annotation coverage, this leaves critical behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, front-loading the key action and target. It's appropriately sized for the tool's complexity, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, nested objects, no output schema, and no annotations, the description is insufficient. It doesn't explain what 'configuration' means in practice, how it's delivered, or any behavioral context, leaving significant gaps for the agent to infer usage in a complex environment with many sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 80%, providing good documentation for parameters like 'apiVersion' and 'features'. The description adds no additional parameter semantics beyond what the schema already explains, so it meets the baseline for high schema coverage without compensating for the 20% gap (e.g., clarifying 'errorBoundary' or 'loadingMask' usage).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate configuration') and target ('for DHIS2 App Runtime integration'), providing a specific verb and resource. However, it doesn't differentiate from sibling tools like 'dhis2_configure_app_manifest' or 'dhis2_init_webapp' that might also handle configuration aspects, so it doesn't reach the highest clarity level.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools related to DHIS2 configuration (e.g., 'dhis2_configure_app_manifest', 'dhis2_init_webapp'), there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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