Skip to main content
Glama

dhis2_android_configure_camera

Configure camera settings for the DHIS2 Android app to enable photo capture, video recording, barcode scanning, and document scanning with customizable resolution, quality, and format options.

Instructions

Set up camera and media capture capabilities for DHIS2 Android app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cameraFeaturesYesCamera features to enable
imageSettingsNo
videoSettingsNo
barcodeTypesNoSupported barcode formats
permissionsNoRequired permissions for media capture

Implementation Reference

  • The core handler function that executes the tool by generating complete Android camera configuration including permissions, CameraX/VideoCapture setup, barcode scanning with ML Kit, usage examples, and testing code.
    export function generateCameraConfiguration(args: any): string {
      const { cameraFeatures, imageSettings, videoSettings, barcodeTypes, permissions } = args;
    
      return `# DHIS2 Android Camera Configuration
    
    ## Features: ${cameraFeatures.join(', ')}
    
    ${generateCameraPermissions(permissions)}
    
    ${generateCameraImplementation(cameraFeatures, imageSettings, videoSettings, barcodeTypes)}
    
    ${cameraFeatures.includes('barcode_scanning') ? generateBarcodeScanning(barcodeTypes) : ''}
    
    ## Usage Examples
    
    \`\`\`kotlin
    class DataCaptureActivity : AppCompatActivity() {
        
        private val cameraManager by lazy { DHIS2CameraManager(this) }
        
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            
            binding.capturePhotoButton.setOnClickListener {
                capturePhoto()
            }
            
            ${cameraFeatures.includes('barcode_scanning') ? `
            binding.scanBarcodeButton.setOnClickListener {
                scanBarcode()
            }` : ''}
        }
        
        private fun capturePhoto() {
            cameraManager.capturePhoto { result ->
                when (result) {
                    is CameraResult.Success -> {
                        // Handle captured photo
                        handleCapturedPhoto(result.imageUri)
                    }
                    is CameraResult.Error -> {
                        showError(result.message)
                    }
                }
            }
        }
        
        ${cameraFeatures.includes('barcode_scanning') ? `
        private fun scanBarcode() {
            cameraManager.scanBarcode { barcode ->
                // Handle scanned barcode
                updateDataElementWithBarcode(barcode)
            }
        }` : ''}
    }
    \`\`\`
    `;
    }
  • src/index.ts:1297-1307 (registration)
    Registers and dispatches calls to the tool handler in the MCP server's CallToolRequestSchema handler.
    case 'dhis2_android_configure_camera':
      const cameraArgs = args as any;
      const cameraConfig = generateCameraConfiguration(cameraArgs);
      return {
        content: [
          {
            type: 'text',
            text: cameraConfig,
          },
        ],
      };
  • Maps the tool to required user permission 'canUseMobileFeatures' in the permission system used for tool filtering.
    ['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'],
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 'Set[s] up' capabilities, implying a configuration or write operation, but does not detail side effects, permissions required beyond the schema, error conditions, or what success looks like. 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, direct sentence that efficiently conveys the core function without unnecessary words. It is front-loaded and avoids redundancy, making it easy 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?

For a tool with 5 parameters, nested objects, no annotations, and no output schema, the description is insufficient. It lacks details on behavioral outcomes, error handling, and how parameters interact, leaving significant gaps in understanding for an AI agent tasked with correct invocation.

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?

The description does not add any parameter-specific information beyond the input schema, which has 60% coverage. It mentions 'camera and media capture capabilities' broadly, aligning with parameters like 'cameraFeatures' and 'videoSettings', but fails to explain relationships between parameters or provide usage examples. Given the moderate schema coverage, the baseline score of 3 is appropriate.

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 resource ('camera and media capture capabilities for DHIS2 Android app'), making the purpose evident. However, it does not explicitly differentiate from sibling tools like 'dhis2_android_configure_notifications' or 'dhis2_android_configure_storage', which reduces clarity in a crowded toolset.

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, such as other configuration tools in the list. There is no mention of prerequisites, dependencies, or specific scenarios where this tool is appropriate, leaving the agent without contextual usage cues.

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