Skip to main content
Glama

dhis2_init_webapp

Initialize a DHIS2 web application project with proper scaffolding by specifying app name, type, and template to create structured health information system applications.

Instructions

Initialize a new DHIS2 web application project with proper scaffolding

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesName of the application (e.g., "my-health-app")
appTitleYesHuman-readable title of the application
appDescriptionNoDescription of the application
namespaceNoApp namespace (defaults to appName if not provided)
appTypeNoType of DHIS2 application
templateNoApp template to use
typescriptNoUse TypeScript (default: true)
pwaNoEnable Progressive Web App features
outputPathNoDirectory path where to create the app (default: current directory)

Implementation Reference

  • Primary handler for the dhis2_init_webapp tool. Destructures input parameters and invokes generateWebAppInitInstructions to produce a comprehensive Markdown guide for initializing a DHIS2 web application.
    case 'dhis2_init_webapp':
      const { appName, appTitle, appDescription, namespace, appType, template, typescript, pwa, outputPath } = args as any;
      const initInstructions = generateWebAppInitInstructions(appName, appTitle, appDescription, { namespace, appType, template, typescript, pwa, outputPath });
      return {
        content: [
          {
            type: 'text',
            text: initInstructions,
          },
        ],
      };
  • Core helper function that generates detailed Markdown instructions for DHIS2 web app setup, including project structure, commands, templates, PWA config, and next steps.
    export function generateWebAppInitInstructions(
      appName: string, 
      appTitle: string, 
      appDescription: string,
      options: any = {}
    ): string {
      const { namespace, appType = 'app', template = 'basic', typescript = true, pwa = false, outputPath = './' } = options;
    
      return `# DHIS2 Web App Initialization Guide
    
    ## App Configuration
    - **App Name**: ${appName}
    - **App Title**: ${appTitle}
    - **Description**: ${appDescription || 'A DHIS2 web application'}
    - **Namespace**: ${namespace || appName}
    - **App Type**: ${appType}
    - **Template**: ${template}
    - **TypeScript**: ${typescript ? 'Yes' : 'No'}
    - **PWA Enabled**: ${pwa ? 'Yes' : 'No'}
    - **Output Path**: ${outputPath}
    
    ## Quick Start Commands
    
    \`\`\`bash
    # Initialize new DHIS2 app using App Platform
    npx @dhis2/cli-app-scripts init ${appName}
    
    # Navigate to project directory
    cd ${appName}
    
    # Install dependencies
    yarn install
    
    # Start development server
    yarn start
    \`\`\`
    
    ## Project Structure
    \`\`\`
    ${appName}/
    ├── src/
    │   ├── App.js${typescript ? 'x' : ''}
    │   ├── components/
    │   └── index.js${typescript ? 'x' : ''}
    ├── public/
    │   └── manifest.webapp
    ├── d2.config.js
    ├── package.json
    ${typescript ? '├── tsconfig.json' : ''}
    ${pwa ? '├── workbox.config.js' : ''}
    └── README.md
    \`\`\`
    
    ## Next Steps
    1. Configure your DHIS2 instance connection
    2. Set up proxy for development
    3. Add CORS allowlist configuration
    4. Implement your app components
    5. Test with different DHIS2 versions
    
    ## Template-Specific Features
    ${generateTemplateFeatures(template)}
    
    ${pwa ? generatePWAConfiguration() : ''}
    `;
    }
  • Registers permission requirement for dhis2_init_webapp tool: requires 'canConfigureApps' permission. Part of TOOL_PERMISSIONS map used for filtering tool access.
    ['dhis2_init_webapp', 'canConfigureApps'],
  • Configures dhis2_init_webapp as a trigger for the 'development-pipeline' multi-server composition workflow, enabling automated follow-up actions like git commits and notifications.
      triggers: ['dhis2_init_webapp']
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool initializes a project but lacks details on what 'proper scaffolding' entails, whether it modifies existing files, requires specific permissions, or has side effects like generating directories or configuration files. This is insufficient for a tool that likely performs file system operations.

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 that front-loads the core action and resource without unnecessary details. It earns its place by clearly stating the tool's purpose in a compact form.

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?

For a tool with 9 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'proper scaffolding' includes, the expected output (e.g., generated files), or behavioral aspects like error handling. Given the complexity and lack of structured data, more context is needed.

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 100%, so the schema fully documents all 9 parameters. The description adds no additional parameter information beyond implying scaffolding creation, which is already covered by the tool's purpose. This meets the baseline for high schema coverage.

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 ('Initialize') and the resource ('new DHIS2 web application project'), specifying it creates proper scaffolding. However, it doesn't explicitly differentiate from sibling tools like 'dhis2_android_init_project' or 'dhis2_setup_dev_environment', which may have overlapping initialization purposes.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, target scenarios, or comparisons with sibling tools such as 'dhis2_android_init_project' for mobile apps or 'dhis2_setup_dev_environment' for general setup.

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