Skip to main content
Glama

dhis2_create_ui_components

Generate UI components for DHIS2 applications using the official UI library. Create forms, tables, dashboards, and other interface elements with built-in data integration, validation, and responsive design features.

Instructions

Generate common UI components using DHIS2 UI library patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentTypeYesType of component to generate
componentNameYesName of the component
featuresNo
dataIntegrationNo
stylingNo

Implementation Reference

  • Main handler for the 'dhis2_create_ui_components' tool call. Receives arguments, invokes generateUIComponents from webapp-generators.ts, and returns generated content.
    case 'dhis2_create_ui_components': const uiArgs = args as any; const uiComponents = generateUIComponents(uiArgs); return { content: [ { type: 'text', text: uiComponents, }, ], };
  • Core helper function that generates markdown with DHIS2 UI component code (React/@dhis2/ui). Dispatches to type-specific generators (form, table, etc.) based on componentType.
    export function generateUIComponents(args: any): string { const { componentType, componentName, features = {}, dataIntegration = {}, styling = {} } = args; return `# DHIS2 UI Component: ${componentName} ## Component Implementation ${generateComponentCode(componentType, componentName, features, dataIntegration, styling)} ## Usage Example \`\`\`jsx import { ${componentName} } from './components/${componentName}'; function App() { return ( <div> <${componentName} /> </div> ); } \`\`\` ## Features Included ${Object.entries(features).map(([feature, enabled]) => enabled ? `- ✅ ${feature.replace(/_/g, ' ').toUpperCase()}` : `- ❌ ${feature.replace(/_/g, ' ').toUpperCase()}` ).join('\n')} ## Styling Options - **Theme**: ${styling.theme || 'default'} - **Custom CSS**: ${styling.customCss ? 'Enabled' : 'Disabled'} ${dataIntegration.apiEndpoint ? ` ## API Integration - **Endpoint**: ${dataIntegration.apiEndpoint} - **Data Query**: ${dataIntegration.useDataQuery ? 'Enabled' : 'Disabled'} - **Data Mutation**: ${dataIntegration.useDataMutation ? 'Enabled' : 'Disabled'} ` : ''} `; }
  • Registers the tool in TOOL_PERMISSIONS map, requiring 'canUseUITools' permission for access control.
    ['dhis2_create_ui_components', 'canUseUITools'],

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