Skip to main content
Glama

android_generate_navigation_drawer

Create Android navigation drawer components using Jetpack Compose for DHIS2 mobile applications, with options for Navigation Compose integration and Material 3 dynamic colors.

Instructions

Generate Android navigation drawer pattern (Compose)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameNoComposable name
navComposeNoInclude Navigation Compose sample
dynamicColorNoUse Material 3 dynamic color in scaffold

Implementation Reference

  • MCP tool handler that invokes the navigation drawer generator function with provided arguments and returns the generated code as text content.
    const aNavArgs = args as any;
    const aNav = generateAndroidNavigationDrawer(aNavArgs);
    return { content: [{ type: 'text', text: aNav }] };
  • Core generator function that produces complete Jetpack Compose code for a Material Design Navigation Drawer, including drawer state management, menu items, top app bar with hamburger menu, and scaffold structure.
    export function generateAndroidNavigationDrawer(args: any): string {
      const { componentName = 'AppNavigation' } = args;
    
      return `# Android Navigation Drawer (Compose): ${componentName}
    
    ## Implementation
    \`\`\`kotlin
    @OptIn(ExperimentalMaterial3Api::class)
    @Composable
    fun ${componentName}() {
        val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
        val scope = rememberCoroutineScope()
    
        ModalNavigationDrawer(
            drawerState = drawerState,
            drawerContent = {
                ModalDrawerSheet {
                    NavigationDrawerItem(label = { Text("Dashboard") }, selected = true, onClick = { })
                    NavigationDrawerItem(label = { Text("Data Entry") }, selected = false, onClick = { })
                    NavigationDrawerItem(label = { Text("Reports") }, selected = false, onClick = { })
                }
            }
        ) {
            Scaffold(topBar = {
                TopAppBar(title = { Text("My DHIS2 App") }, navigationIcon = {
                    IconButton(onClick = { scope.launch { drawerState.open() } }) {
                        Icon(Icons.Default.Menu, contentDescription = null)
                    }
                })
            }) { padding ->
                Box(Modifier.padding(padding)) {
                    Text("Content goes here")
                }
            }
        }
    }
    \`\`\`
    `;
    }
  • Tool permissions registration mapping 'android_generate_navigation_drawer' to 'canUseMobileFeatures' permission check for access control.
      ['android_generate_material_form', 'canUseMobileFeatures'],
      ['android_generate_list_adapter', 'canUseMobileFeatures'],
      ['android_generate_navigation_drawer', 'canUseMobileFeatures'],
      ['android_generate_bottom_sheet', '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 'generates' something, implying a creation/write operation, but doesn't specify what exactly is generated (e.g., code files, configuration), where output goes, or any side effects. No information about permissions, rate limits, or error handling is included, leaving significant gaps for a generation tool.

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 extremely concise with a single, front-loaded sentence: 'Generate Android navigation drawer pattern (Compose)'. Every word contributes essential information without waste. It efficiently communicates the core purpose in minimal space.

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 purpose (generating code/patterns), no annotations, no output schema, and 3 parameters, the description is incomplete. It doesn't explain what the tool produces (e.g., code snippets, files, configurations), how output is delivered, or any behavioral aspects. For a generation tool with zero annotation coverage, this minimal description leaves too many questions unanswered.

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 already documents all three parameters with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema. According to guidelines, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.

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 tool's purpose: 'Generate Android navigation drawer pattern (Compose)'. It specifies the verb ('Generate'), resource ('Android navigation drawer pattern'), and technology context ('Compose'), making it distinct from most siblings that focus on DHIS2 configuration or other Android patterns. However, it doesn't explicitly differentiate from 'android_generate_bottom_sheet' or 'android_generate_list_adapter' which are also Android generation tools.

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. It doesn't mention any prerequisites, context for Android development, or comparisons to sibling tools like 'android_generate_bottom_sheet' or 'dhis2_generate_ui_navigation_layout'. The agent must infer usage from the tool name and description alone.

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