Skip to main content
Glama

dhis2_android_configure_storage

Configure local storage settings for DHIS2 Android apps, including database type, encryption, caching strategies, and data retention policies.

Instructions

Set up local storage and database configuration for DHIS2 Android app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storageTypeYesLocal database technology
encryptionLevelNoDatabase encryption level
cacheStrategyNo
purgePolicyNo

Implementation Reference

  • MCP tool handler that extracts arguments, calls generateStorageConfiguration from android-generators.ts, and returns the generated storage configuration as text content.
    case 'dhis2_android_configure_storage':
      const storageArgs = args as any;
      const storageConfig = generateStorageConfiguration(storageArgs);
      return {
        content: [
          {
            type: 'text',
            text: storageConfig,
          },
        ],
      };
  • Core helper function that generates comprehensive Android storage configuration code including database setup (Room/SQLite/Realm), encryption, caching strategies, purge policies, and usage examples based on input parameters.
    export function generateStorageConfiguration(args: any): string {
      const { storageType, encryptionLevel, cacheStrategy, purgePolicy } = args;
    
      return `# DHIS2 Android Storage Configuration
    
    ## Database Technology: ${storageType.toUpperCase()}
    ## Encryption Level: ${encryptionLevel.toUpperCase()}
    
    ${generateDatabaseConfiguration(storageType, encryptionLevel)}
    
    ${cacheStrategy ? generateCacheStrategy(cacheStrategy) : ''}
    
    ${purgePolicy?.enabled ? generatePurgePolicy(purgePolicy) : ''}
    
    ## Usage Examples
    
    \`\`\`kotlin
    @Database(
        entities = [DataElement::class, OrganisationUnit::class, Event::class],
        version = 1,
        exportSchema = false
    )
    ${encryptionLevel !== 'none' ? '@TypeConverters(CryptoConverter::class)' : ''}
    abstract class DHIS2Database : RoomDatabase() {
        abstract fun dataElementDao(): DataElementDao
        abstract fun organisationUnitDao(): OrganisationUnitDao
        abstract fun eventDao(): EventDao
        
        companion object {
            @Volatile
            private var INSTANCE: DHIS2Database? = null
            
            fun getDatabase(context: Context): DHIS2Database {
                return INSTANCE ?: synchronized(this) {
                    val instance = Room.databaseBuilder(
                        context.applicationContext,
                        DHIS2Database::class.java,
                        "dhis2_database"
                    ).apply {
                        ${encryptionLevel !== 'none' ? 'openHelperFactory(SupportFactory(getPassphrase()))' : ''}
                        ${cacheStrategy ? 'setQueryExecutor(Executors.newFixedThreadPool(4))' : ''}
                    }.build()
                    INSTANCE = instance
                    instance
                }
            }
            
            ${encryptionLevel !== 'none' ? `
            private fun getPassphrase(): ByteArray {
                // Generate or retrieve secure passphrase
                return "your-secure-passphrase".toByteArray()
            }` : ''}
        }
    }
    \`\`\`
    `;
    }
  • Tool permissions registration mapping 'dhis2_android_configure_storage' to 'canConfigureMobile' permission check in PermissionSystem.TOOL_PERMISSIONS Map.
    ['dhis2_android_configure_storage', 'canConfigureMobile'],
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'sets up' configuration without disclosing behavioral traits. It doesn't mention whether this is a one-time setup, if it modifies existing configurations, requires specific permissions, has side effects, or how changes persist. This is inadequate for a configuration tool with multiple parameters.

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, 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?

Given the complexity (4 parameters with nested objects, 50% schema coverage, no annotations, no output schema), the description is insufficient. It lacks details on behavior, parameter usage, expected outcomes, or integration with other tools, making it incomplete for effective agent use.

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 50%, and the description adds no parameter-specific information beyond implying storage/database configuration. It doesn't explain the meaning or relationships of parameters like 'storageType', 'encryptionLevel', or nested objects, leaving gaps. However, the schema provides some enum descriptions, maintaining a baseline score.

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 ('local storage and database configuration for DHIS2 Android app'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'dhis2_android_configure_camera' or 'dhis2_android_configure_notifications' beyond the storage/database focus, which prevents a perfect score.

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, timing (e.g., during app initialization), or relationships with siblings like 'dhis2_android_init_project' or 'dhis2_android_setup_sync', leaving the agent without context for tool selection.

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