Skip to main content
Glama

dhis2_android_setup_authentication

Configure authentication and security settings for the DHIS2 Android app by setting up methods like biometric, PIN, or OAuth2 and enabling security features such as session management and device protection.

Instructions

Configure authentication and security patterns for DHIS2 Android app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authMethodsYesAuthentication methods to support
biometricSettingsNo
sessionManagementNo
securityFeaturesNo

Implementation Reference

  • Main handler for the tool in the MCP server request handler switch statement. Extracts arguments and calls the generator function to produce authentication configuration.
    case 'dhis2_android_setup_authentication':
      const androidAuthArgs = args as any;
      const authConfig = generateAndroidAuthenticationConfig(androidAuthArgs);
      return {
        content: [
          {
            type: 'text',
            text: authConfig,
          },
        ],
      };
  • Core generator function that produces the authentication setup markdown/code/configuration based on input arguments. This is the primary logic execution for the tool.
    export function generateAndroidAuthenticationConfig(args: any): string {
      return `# DHIS2 Android Authentication Configuration
    
    Authentication methods: ${args.authMethods.join(', ')}
    
    ## Implementation details for Android authentication patterns...
    `;
    }
  • Tool permission registration/mapping. Associates the tool with 'canConfigureMobile' permission, controlling access based on user permissions.
    private static readonly TOOL_PERMISSIONS = new Map<string, keyof UserPermissions | Array<keyof UserPermissions>>([
      // Configuration and connection
      ['dhis2_configure', 'canViewSystemInfo'],
      ['dhis2_get_system_info', 'canViewSystemInfo'],
      
      // Metadata operations - Data Elements
      ['dhis2_list_data_elements', 'canViewMetadata'],
      ['dhis2_create_data_element', 'canCreateMetadata'],
      ['dhis2_update_data_element', 'canUpdateMetadata'],
      ['dhis2_delete_data_element', 'canDeleteMetadata'],
      
      // Metadata operations - Data Sets
      ['dhis2_list_data_sets', 'canViewMetadata'],
      ['dhis2_create_data_set', 'canCreateMetadata'],
      
      // Metadata operations - Categories
      ['dhis2_list_categories', 'canViewMetadata'],
      ['dhis2_create_category', 'canCreateMetadata'],
      ['dhis2_list_category_options', 'canViewMetadata'],
      ['dhis2_create_category_option', 'canCreateMetadata'],
      ['dhis2_list_category_combos', 'canViewMetadata'],
      ['dhis2_create_category_combo', 'canCreateMetadata'],
      ['dhis2_list_category_option_combos', 'canViewMetadata'],
      
      // Organisation Units
      ['dhis2_list_org_units', 'canViewMetadata'],
      ['dhis2_list_org_unit_groups', 'canViewMetadata'],
      ['dhis2_create_org_unit_group', 'canCreateMetadata'],
      
      // Validation Rules
      ['dhis2_list_validation_rules', 'canViewMetadata'],
      ['dhis2_create_validation_rule', 'canCreateMetadata'],
      ['dhis2_run_validation', ['canViewData', 'canRunAnalytics']],
      
      // Data Values
      ['dhis2_get_data_values', 'canViewData'],
      ['dhis2_bulk_import_data_values', 'canImportData'],
      
      // Analytics
      ['dhis2_get_analytics', 'canRunAnalytics'],
      ['dhis2_get_data_statistics', 'canRunAnalytics'],
      
      // Programs (Tracker)
      ['dhis2_list_programs', 'canViewMetadata'],
      ['dhis2_create_program', 'canManagePrograms'],
      ['dhis2_list_tracked_entity_types', 'canViewMetadata'],
      ['dhis2_create_tracked_entity_type', 'canManagePrograms'],
      ['dhis2_list_tracked_entity_attributes', 'canViewMetadata'],
      ['dhis2_create_tracked_entity_attribute', 'canManagePrograms'],
      ['dhis2_list_program_stages', 'canViewMetadata'],
      ['dhis2_create_program_stage', 'canManagePrograms'],
      ['dhis2_list_program_rules', 'canViewMetadata'],
      ['dhis2_create_program_rule', 'canManagePrograms'],
      
      // Tracker Data
      ['dhis2_list_tracked_entity_instances', 'canViewTEI'],
      ['dhis2_create_tracked_entity_instance', 'canEnrollTEI'],
      ['dhis2_list_enrollments', 'canViewTEI'],
      ['dhis2_create_enrollment', 'canEnrollTEI'],
      ['dhis2_list_events', 'canViewTEI'],
      ['dhis2_create_event', 'canManageTrackerData'],
      ['dhis2_bulk_import_events', 'canImportData'],
      ['dhis2_get_event_analytics', 'canRunAnalytics'],
      ['dhis2_get_enrollment_analytics', 'canRunAnalytics'],
      
      // Dashboards and Visualizations
      ['dhis2_list_dashboards', 'canViewData'],
      ['dhis2_create_dashboard', 'canManageDashboards'],
      ['dhis2_list_visualizations', 'canViewData'],
      ['dhis2_create_visualization', 'canManageDashboards'],
      ['dhis2_list_reports', 'canViewData'],
      ['dhis2_generate_report', 'canExportData'],
      
      // Web App Platform Tools
      ['dhis2_init_webapp', 'canConfigureApps'],
      ['dhis2_configure_app_manifest', 'canConfigureApps'],
      ['dhis2_configure_build_system', 'canConfigureApps'],
      ['dhis2_setup_dev_environment', 'canConfigureApps'],
      ['dhis2_generate_app_runtime_config', 'canConfigureApps'],
      ['dhis2_create_datastore_namespace', 'canConfigureApps'],
      ['dhis2_manage_datastore_key', 'canConfigureApps'],
      ['dhis2_setup_authentication_patterns', 'canConfigureApps'],
      ['dhis2_create_ui_components', 'canUseUITools'],
      ['dhis2_generate_test_setup', 'canConfigureApps'],
      
      // Debugging Tools
      ['dhis2_diagnose_cors_issues', 'canDebugApplications'],
      ['dhis2_configure_cors_allowlist', 'canDebugApplications'],
      ['dhis2_debug_authentication', 'canDebugApplications'],
      ['dhis2_fix_proxy_configuration', 'canDebugApplications'],
      ['dhis2_resolve_build_issues', 'canDebugApplications'],
      ['dhis2_optimize_performance', 'canDebugApplications'],
      ['dhis2_validate_environment', 'canDebugApplications'],
      ['dhis2_migration_assistant', 'canDebugApplications'],
      
      // Android SDK Tools
      ['dhis2_android_init_project', 'canUseMobileFeatures'],
      ['dhis2_android_configure_gradle', 'canUseMobileFeatures'],
      ['dhis2_android_setup_sync', 'canConfigureMobile'],
      ['dhis2_android_configure_storage', 'canConfigureMobile'],
      ['dhis2_android_setup_location_services', 'canUseMobileFeatures'],
      ['dhis2_android_configure_camera', 'canUseMobileFeatures'],
      ['dhis2_android_setup_authentication', 'canConfigureMobile'],
      ['dhis2_android_generate_data_models', 'canUseMobileFeatures'],
      ['dhis2_android_setup_testing', 'canUseMobileFeatures'],
      ['dhis2_android_configure_ui_patterns', 'canUseMobileFeatures'],
      ['dhis2_android_setup_offline_analytics', 'canUseMobileFeatures'],
      ['dhis2_android_configure_notifications', 'canUseMobileFeatures'],
      ['dhis2_android_performance_optimization', 'canUseMobileFeatures'],
      
      // UI Library Tools
      ['dhis2_generate_ui_form_patterns', 'canUseUITools'],
      ['dhis2_generate_ui_data_display', 'canUseUITools'],
      ['dhis2_generate_ui_navigation_layout', 'canUseUITools'],
      ['dhis2_generate_design_system', 'canUseUITools'],
      ['android_generate_material_form', 'canUseMobileFeatures'],
      ['android_generate_list_adapter', 'canUseMobileFeatures'],
      ['android_generate_navigation_drawer', 'canUseMobileFeatures'],
      ['android_generate_bottom_sheet', 'canUseMobileFeatures'],
    ]);
  • Documentation/reference to the tool in project initialization guide, recommending its use after project init.
    2. **Set up Authentication**: Use \`dhis2_android_setup_authentication\` tool  
    3. **Configure Data Sync**: Use \`dhis2_android_setup_sync\` tool
  • Reference to the tool in Gradle configuration next steps.
    1. **Sync project** - Click "Sync Now" in Android Studio
    2. **Configure authentication** - Use \`dhis2_android_setup_authentication\`  
    3. **Set up data models** - Use \`dhis2_android_generate_data_models\`
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Configure' implies a write/mutation operation, but the description doesn't specify whether this is a one-time setup, requires admin permissions, has side effects, or what happens on success/failure. For a security configuration tool with zero annotation coverage, this is a significant gap in behavioral transparency.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.

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 security configuration tool with 4 parameters (including nested objects), no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, or the implications of configuring these security settings. The complexity of the input schema demands more contextual information than provided.

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 only 25%, meaning most parameters lack documentation in the schema. The description mentions 'authentication and security patterns' which hints at the scope of parameters, but doesn't provide specific details about what each parameter controls or how they interact. It adds minimal value beyond the low-coverage schema.

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 verb ('configure') and resource ('authentication and security patterns for DHIS2 Android app'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'dhis2_setup_authentication_patterns' or 'dhis2_debug_authentication', which could cause confusion about when to use this specific tool versus those alternatives.

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, prerequisites, or typical scenarios. With multiple authentication-related tools in the sibling list (e.g., 'dhis2_setup_authentication_patterns', 'dhis2_debug_authentication'), the lack of differentiation leaves the agent without clear usage context.

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