Skip to main content
Glama

dhis2_setup_dev_environment

Configure a local development environment for DHIS2 applications with proxy setup and hot reload functionality to streamline app testing and debugging.

Instructions

Set up development environment for DHIS2 app with proper proxy and hot reload

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dhis2InstanceYesDHIS2 instance URL for development proxy
usernameYesDHIS2 username for development
passwordYesDHIS2 password for development
portNoLocal development server port (default: 3000)
httpsNoUse HTTPS for local development
envFileNoPath to environment file (default: .env.local)

Implementation Reference

  • Handler for 'dhis2_setup_dev_environment' tool: extracts arguments, calls generateDevEnvironmentConfig, and returns markdown configuration as text content.
    case 'dhis2_setup_dev_environment':
      const devEnvArgs = args as any;
      const devEnvConfig = generateDevEnvironmentConfig(devEnvArgs);
      return {
        content: [
          {
            type: 'text',
            text: devEnvConfig,
          },
        ],
      };
  • Core helper function generateDevEnvironmentConfig that generates comprehensive markdown instructions for DHIS2 dev environment setup including env vars, commands, CORS fixes, and security notes.
    export function generateDevEnvironmentConfig(args: any): string {
      const { dhis2Instance, username, password, port = 3000, https = false, envFile = '.env.local' } = args;
    
      return `# DHIS2 Development Environment Setup
    
    ## Environment File (${envFile})
    \`\`\`bash
    # DHIS2 Instance Configuration
    REACT_APP_DHIS2_BASE_URL=${dhis2Instance}
    DHIS2_CORE_HOST=${dhis2Instance}
    DHIS2_CORE_USERNAME=${username}
    DHIS2_CORE_PASSWORD=${password}
    
    # Development Server Configuration
    PORT=${port}
    ${https ? 'HTTPS=true' : '# HTTPS=false'}
    
    # API Configuration
    REACT_APP_DHIS2_API_VERSION=40
    GENERATE_SOURCEMAP=true
    \`\`\`
    
    ## Development Commands
    \`\`\`bash
    # Start with proxy
    yarn start --proxy
    
    # Start with specific port
    yarn start --port ${port}
    
    # Start with HTTPS${https ? '' : ' (if needed)'}
    ${https ? 'yarn start --https' : '# yarn start --https'}
    \`\`\`
    
    ## Browser Configuration for CORS
    ### Chrome (recommended for development)
    \`\`\`bash
    # Start Chrome with disabled security (development only!)
    google-chrome --disable-web-security --user-data-dir=/tmp/chrome-dev
    \`\`\`
    
    ### Firefox
    1. Open about:config
    2. Set \`network.cookie.sameSite.laxByDefault\` to \`false\`
    3. Set \`network.cookie.sameSite.noneRequiresSecure\` to \`false\`
    
    ## Troubleshooting Tips
    - Clear browser cache if authentication fails
    - Check DHIS2 CORS allowlist settings
    - Verify DHIS2 instance is accessible
    - Use browser dev tools Network tab for debugging
    
    ## Security Notes
    ⚠️ **Never commit credentials to version control!**
    - Add ${envFile} to .gitignore
    - Use different credentials for development
    - Rotate passwords regularly
    `;
    }
  • Permission registration in TOOL_PERMISSIONS map: requires 'canConfigureApps' permission to execute the tool.
    ['dhis2_configure_build_system', 'canConfigureApps'],
    ['dhis2_setup_dev_environment', 'canConfigureApps'],
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 mentions setting up a proxy and hot reload, but lacks details on what the tool actually does (e.g., creates config files, starts servers, modifies code), potential side effects, authentication requirements beyond parameters, or error handling. This is inadequate for a tool with multiple parameters and no output schema.

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 purpose without unnecessary words. Every part ('Set up development environment', 'DHIS2 app', 'proper proxy and hot reload') contributes essential information, making it appropriately concise for the tool's complexity.

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's complexity (6 parameters, no annotations, no output schema), the description is insufficient. It lacks details on what the setup entails, expected outcomes, behavioral traits, or error conditions. While the schema covers parameters well, the description fails to provide the broader context needed for effective use, especially for a setup tool with potential side effects.

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%, providing clear documentation for all 6 parameters. The description adds no additional parameter semantics beyond implying that 'dhis2Instance', 'username', and 'password' are used for the proxy setup, but this is already inferred from the schema. Baseline score of 3 is appropriate as the schema does the heavy lifting.

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 ('Set up') and target ('development environment for DHIS2 app'), specifying key features like proxy and hot reload. It distinguishes itself from sibling tools focused on Android configuration, webapp initialization, or environment validation, though it doesn't explicitly differentiate from similar setup tools like 'dhis2_init_webapp'.

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 explicit guidance on when to use this tool versus alternatives is provided. The description implies usage for DHIS2 app development setup, but it doesn't specify prerequisites, timing relative to other tools (e.g., before 'dhis2_init_webapp'), or exclusions for non-development scenarios.

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