Skip to main content
Glama

dhis2_setup_authentication_patterns

Generate authentication patterns and examples for DHIS2 applications, supporting multiple authentication types and providers with configurable security features.

Instructions

Generate authentication patterns and examples for DHIS2 app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authTypeYesType of authentication to implement
providersNoAuthentication providers to support
sessionManagementNo
securityFeaturesNo
redirectUrlsNo

Implementation Reference

  • Handler function that generates authentication setup patterns and code examples
    export function generateAuthenticationPatterns(args: any): string {
      const { authType, providers = [], sessionManagement = {}, securityFeatures = {}, redirectUrls = {} } = args;
    
      return `# DHIS2 Authentication Patterns
    
    ## ${authType.toUpperCase()} Authentication Setup
    
    ${generateAuthTypeImplementation(authType)}
    
    ${providers.length > 0 ? generateProviderIntegration(providers) : ''}
    
    ## Session Management
    \`\`\`javascript
    const sessionConfig = {
      timeout: ${sessionManagement.timeout || 30}, // minutes
      refreshTokens: ${sessionManagement.refreshTokens || false},
      rememberUser: ${sessionManagement.rememberUser || false}
    };
    \`\`\`
    
    ${Object.keys(securityFeatures).length > 0 ? generateSecurityConfiguration(securityFeatures) : ''}
    
    ## Redirect Configuration
    \`\`\`javascript
    const redirectConfig = {
      success: '${redirectUrls.success || '/dashboard'}',
      failure: '${redirectUrls.failure || '/login'}',
      logout: '${redirectUrls.logout || '/login'}'
    };
    \`\`\`
    
    ## Testing Authentication
    \`\`\`bash
    # Test login endpoint
    curl -X POST \\
      -H "Content-Type: application/json" \\
      -d '{"username":"admin","password":"district"}' \\
      https://your-dhis2-instance.com/api/auth/login
    
    # Test current user endpoint
    curl -H "Cookie: JSESSIONID=your-session-id" \\
      https://your-dhis2-instance.com/api/me
    \`\`\`
    `;
    }
  • src/index.ts:1045-1055 (registration)
    Tool registration and dispatch handler in the main MCP server index file, calling the generateAuthenticationPatterns function with user arguments and returning the generated markdown as tool response
    case 'dhis2_setup_authentication_patterns':
      const authArgs = args as any;
      const authPatterns = generateAuthenticationPatterns(authArgs);
      return {
        content: [
          {
            type: 'text',
            text: authPatterns,
          },
        ],
      };
  • Permission mapping registration associating the tool with 'canConfigureApps' permission requirement in the TOOL_PERMISSIONS map
    ['dhis2_setup_authentication_patterns', 'canConfigureApps'],
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'generates' patterns and examples, implying a read-only or creation operation, but doesn't specify output format (e.g., files, code, text), whether it modifies existing configurations, or any side effects like rate limits or authentication requirements. This is a significant gap for a tool with complex parameters and no output schema.

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 with no wasted words. It's appropriately sized for a tool name that already hints at the domain (DHIS2), making it front-loaded and 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 (5 parameters with nested objects, 40% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't address what the tool outputs, how parameters influence the generation, or behavioral traits. For a tool that likely produces configuration or code examples, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 40%, meaning most parameters lack descriptions in the schema. The tool description doesn't add any parameter-specific information beyond what's implied by the tool name (e.g., it doesn't explain how 'authType' or 'providers' relate to 'patterns and examples'). With 5 parameters and low schema coverage, the description fails to compensate, leaving key semantics unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Generate authentication patterns and examples for DHIS2 app' states a clear verb ('Generate') and resource ('authentication patterns and examples'), but it's vague about what constitutes 'patterns and examples' (e.g., code snippets, configuration files, documentation). It distinguishes from most siblings by focusing on authentication, but doesn't explicitly differentiate from 'dhis2_android_setup_authentication', which could be a related tool.

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, context (e.g., for new app setup vs. existing app enhancement), or how it relates to sibling tools like 'dhis2_android_setup_authentication'. This leaves the agent without clear direction on appropriate usage scenarios.

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