Skip to main content
Glama

android_generate_bottom_sheet

Create Android bottom sheet components in Compose for DHIS2 mobile apps. Specify component name and persistent sheet options to generate UI elements for data display and user interactions.

Instructions

Generate Android bottom sheet component (Compose)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameNoComposable name
persistentNoGenerate persistent bottom sheet alternative

Implementation Reference

  • The MCP tool handler for 'android_generate_bottom_sheet'. It extracts arguments, calls the generateAndroidBottomSheet helper function, and returns the generated Kotlin code as text content.
    case 'android_generate_bottom_sheet':
      const aSheetArgs = args as any;
      const aSheet = generateAndroidBottomSheet(aSheetArgs);
      return { content: [{ type: 'text', text: aSheet }] };
  • The supporting utility function that generates a markdown document containing Kotlin Jetpack Compose code for a customizable ModalBottomSheet component.
    export function generateAndroidBottomSheet(args: any): string {
      const { componentName = 'DetailsBottomSheet' } = args;
    
      return `# Android Bottom Sheet (Compose): ${componentName}
    
    ## Implementation
    \`\`\`kotlin
    @OptIn(ExperimentalMaterial3Api::class)
    @Composable
    fun ${componentName}(open: Boolean, onDismiss: () -> Unit, content: @Composable () -> Unit) {
        if (!open) return
        ModalBottomSheet(onDismissRequest = onDismiss) {
            content()
        }
    }
    \`\`\`
    `;
  • The tool is registered in the TOOL_PERMISSIONS map, requiring 'canUseMobileFeatures' permission for access control.
      ['android_generate_bottom_sheet', 'canUseMobileFeatures'],
    ]);
  • Import statement in index.ts that brings the generateAndroidBottomSheet function into scope for use by the tool handler.
      generateTestSetup
    } from './webapp-generators.js';
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 'Generate' which implies a write/creation operation, but doesn't specify what exactly gets generated (e.g., code files, configuration), where the output goes, whether it modifies existing files, or what permissions might be required. For a generation tool with zero annotation coverage, this represents a significant transparency gap.

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 - a single phrase that communicates the core purpose without any wasted words. It's front-loaded with the essential information (generate + what). This represents optimal conciseness for a simple tool description.

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 code generation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the generation produces (Kotlin file, XML, etc.), where the output is placed, whether it integrates with existing project structures, or what happens on success/failure. The agent would need to guess about important behavioral aspects of this generation operation.

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 both parameters (componentName, persistent) are already documented in the schema. The description doesn't add any additional meaning about these parameters beyond what the schema provides - it doesn't explain naming conventions for componentName or clarify what 'persistent' means in practical terms. This meets the baseline expectation when 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 ('Generate') and target resource ('Android bottom sheet component (Compose)'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling Android generation tools (like android_generate_list_adapter or android_generate_navigation_drawer), which would require mentioning what makes a bottom sheet distinct from other UI components.

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. There are no mentions of prerequisites (e.g., needing an Android project context), typical use cases for bottom sheets, or comparisons to other UI component generation tools in the sibling list. This leaves the agent without contextual usage information.

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