Skip to main content
Glama

dhis2_generate_ui_navigation_layout

Generate navigation and layout patterns for DHIS2 applications, including header bars, sidebars, breadcrumbs, and tabs with responsive design options.

Instructions

Generate @dhis2/ui navigation and layout patterns (header bar, sidebar, breadcrumbs, tabs)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameNoComponent name
includeHeaderBarNoInclude HeaderBar
includeSidebarNoInclude sidebar Menu
includeBreadcrumbsNoInclude Breadcrumbs
includeTabsNoInclude TabBar
includeResponsiveNoInclude responsive CSS
useAlertsNoInclude useAlert example for feedback
rtlNoAdd RTL considerations

Implementation Reference

  • The core handler function that generates React JSX code for a DHIS2 UI navigation layout using @dhis2/ui components, including optional header, sidebar, breadcrumbs, tabs, and responsive design.
    export function generateUINavigationLayout(args: any): string {
      const {
        componentName = 'NavigationLayout',
        includeHeaderBar = true,
        includeSidebar = true,
        includeBreadcrumbs = true,
        includeTabs = true,
        includeResponsive = true
      } = args;
    
      return `# @dhis2/ui Navigation & Layout: ${componentName}
    
    ## Implementation
    \`\`\`jsx
    import React from 'react';
    import { Menu, MenuItem, TabBar, Tab, Breadcrumbs, BreadcrumbsItem } from '@dhis2/ui';
    ${includeHeaderBar ? "import { HeaderBar } from '@dhis2/ui';" : ''}
    
    export const ${componentName} = () => {
      const [active, setActive] = React.useState('dashboard');
    
      return (
        <div className="layout">
          ${includeHeaderBar ? '<HeaderBar appName="My DHIS2 App" />' : ''}
    
          <div className="content">
            ${includeSidebar ? `
            <aside className="sidebar">
              <Menu>
                <MenuItem label="Dashboard" active={active==='dashboard'} onClick={() => setActive('dashboard')} />
                <MenuItem label="Data Entry" active={active==='data-entry'} onClick={() => setActive('data-entry')} />
                <MenuItem label="Reports" active={active==='reports'} onClick={() => setActive('reports')} />
              </Menu>
            </aside>
            ` : ''}
    
            <main className="main">
              ${includeBreadcrumbs ? `
              <Breadcrumbs>
                <BreadcrumbsItem>Home</BreadcrumbsItem>
                <BreadcrumbsItem>Section</BreadcrumbsItem>
                <BreadcrumbsItem>Page</BreadcrumbsItem>
              </Breadcrumbs>
              ` : ''}
    
              ${includeTabs ? `
              <TabBar>
                <Tab selected>Overview</Tab>
                <Tab>Details</Tab>
                <Tab>Settings</Tab>
              </TabBar>
              ` : ''}
            </main>
          </div>
        </div>
      );
    };
    
    // Basic layout styles
    const styles = 
    \`.layout { display: flex; flex-direction: column; height: 100vh; }
    .content { display: grid; grid-template-columns: ${includeSidebar ? '240px 1fr' : '1fr'}; flex: 1; min-height: 0; }
    .sidebar { border-right: 1px solid #e5e7eb; padding: 12px; overflow: auto; }
    .main { padding: 16px; overflow: auto; }
    ${includeResponsive ? '@media (max-width: 768px) { .content { grid-template-columns: 1fr; } .sidebar { display:none; } }' : ''}\`;
    \`\`\`
    `;
    }
  • src/index.ts:1088-1095 (registration)
    The MCP server tool dispatch case that registers and handles calls to 'dhis2_generate_ui_navigation_layout' by invoking the generateUINavigationLayout function.
    case 'dhis2_generate_ui_navigation_layout':
      const navArgs = args as any;
      const navCode = generateUINavigationLayout(navArgs);
      return {
        content: [
          { type: 'text', text: navCode }
        ]
      };
  • Permission mapping in TOOL_PERMISSIONS that requires 'canUseUITools' permission for the tool.
    ['dhis2_generate_ui_navigation_layout', 'canUseUITools'],
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool 'generates' patterns but doesn't clarify what that means operationally: whether it creates files, returns code snippets, modifies existing projects, requires specific permissions, or has side effects. For a generation tool with 8 parameters and no annotation coverage, this is a significant gap in transparency.

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 immediately states the core purpose and enumerates the key patterns. Every word earns its place with zero waste or redundancy. It's appropriately sized for a tool with clear parameters documented elsewhere.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a generation tool with 8 parameters, 100% schema coverage, and no output schema, the description is minimally adequate but has gaps. It identifies the domain and patterns but doesn't explain what 'generate' means in practice or what format the output takes. With no annotations and no output schema, the description should provide more operational context about the tool's behavior and results.

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 input schema has 100% description coverage, with each parameter clearly documented in the schema itself. The description mentions the patterns (header bar, sidebar, breadcrumbs, tabs) which correspond to some boolean parameters, but doesn't add meaningful semantic context beyond what's already in the schema descriptions. Baseline 3 is appropriate 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 tool generates '@dhis2/ui navigation and layout patterns' and lists specific patterns (header bar, sidebar, breadcrumbs, tabs), which provides a specific verb+resource. However, it doesn't explicitly differentiate from sibling tools like 'dhis2_generate_ui_data_display' or 'dhis2_generate_ui_form_patterns' that also generate UI components, leaving some ambiguity about scope boundaries.

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 multiple UI generation siblings (e.g., dhis2_generate_ui_data_display, dhis2_generate_ui_form_patterns), but the description doesn't indicate this is specifically for navigation/layout patterns versus other UI aspects. No prerequisites, exclusions, or contextual usage information is provided.

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