Skip to main content
Glama

dhis2_get_composition_recommendations

Generate integration recommendations for connecting DHIS2 operation results with other MCP servers to enhance data workflows.

Instructions

Get recommendations for integrating the result of the last operation with other MCP servers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lastToolNoName of the last tool that was executed

Implementation Reference

  • Handler for 'dhis2_get_composition_recommendations' tool. Extracts 'lastTool' parameter, calls MultiServerComposition.getCompositionRecommendations, logs audit, and formats response with recommendations and server info.
          case 'dhis2_get_composition_recommendations':
            const { lastTool } = args as { lastTool?: string };
            const recommendations = multiServerComposition.getCompositionRecommendations(
              lastTool || 'dhis2_general', 
              {}
            );
            
            auditLogger.log({
              toolName: name,
              parameters: { lastTool },
              outcome: 'success',
              dhis2Instance: dhis2Client?.baseURL,
              userId: currentUser?.username,
              executionTime: Date.now() - startTime
            });
            
            return {
              content: [{
                type: 'text',
                text: `šŸ’” Multi-Server Integration Recommendations
    
    ${lastTool ? `**Based on your last operation:** ${lastTool}` : '**General Recommendations:**'}
    
    **Suggested Next Steps:**
    ${recommendations.length > 0 ? 
      recommendations.map(rec => `  • ${rec}`).join('\n') : 
      '  • No specific recommendations for this operation'
    }
    
    **Available Compatible Servers:** ${multiServerComposition.getCompatibleServers().length}
    ${multiServerComposition.getCompatibleServers().map(server => 
      `  • **${server.name}**: ${server.capabilities.map(c => c.domain).join(', ')}`
    ).join('\n') || '  • Register servers with dhis2_register_compatible_server'}
    
    **Common Integration Patterns:**
      • **Data Quality**: DHIS2 validation → GitHub issues → Slack notifications
      • **Development**: DHIS2 app generation → Git commits → Pull requests
      • **Analytics**: DHIS2 reports → Database storage → Email distribution
      • **Monitoring**: DHIS2 system info → Log aggregation → Alert systems
    
    šŸ”— Use **dhis2_export_for_composition** to prepare data for other servers.`
              }]
            };
  • Core helper method that generates array of string recommendations based on the currentTool name, matching keywords like 'validation', 'init_webapp', etc., to suggest next integration steps.
    getCompositionRecommendations(currentTool: string, result: any): string[] {
      const recommendations: string[] = [];
    
      // Analysis of current tool and suggest next steps
      if (currentTool.includes('validation')) {
        recommendations.push('Create GitHub issue for validation failures');
        recommendations.push('Send Slack notification to data team');
        recommendations.push('Log validation results to database');
      }
    
      if (currentTool.includes('init_webapp')) {
        recommendations.push('Commit generated code to Git repository');
        recommendations.push('Create GitHub pull request');
        recommendations.push('Notify development team via Slack');
      }
    
      if (currentTool.includes('get_analytics')) {
        recommendations.push('Export analytics data to external database');
        recommendations.push('Generate and email automated report');
        recommendations.push('Create dashboard visualization');
      }
    
      if (currentTool.includes('create_data_element')) {
        recommendations.push('Backup metadata to version control');
        recommendations.push('Update documentation in Wiki/GitHub');
        recommendations.push('Notify configuration team');
      }
    
      return recommendations;
  • src/index.ts:104-110 (registration)
    Tool list handler that returns available tools filtered by permissions. The composition tools are handled dynamically via switch cases in CallToolRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      // Filter tools based on user permissions
      const filteredTools = PermissionSystem.filterToolsByPermissions(tools, userPermissions);
      
      return {
        tools: filteredTools,
      };
  • Instantiation of MultiServerComposition class instance used by composition tools including getCompositionRecommendations.
    let multiServerComposition: MultiServerComposition = new MultiServerComposition();
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 mentions 'recommendations' but doesn't specify what form these take (e.g., text suggestions, code snippets, configuration options) or any behavioral traits like whether this is a read-only operation, if it has side effects, or what permissions might be required. The description is too sparse to adequately inform the agent about how this tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently states the tool's purpose without unnecessary words. It's appropriately sized for what it communicates, though it could be more specific. There's no wasted language or redundant information in the brief description provided.

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 of integration recommendations and the lack of both annotations and output schema, the description is insufficiently complete. It doesn't explain what 'recommendations' consist of, how they're formatted, what scope they cover, or what the agent should expect as output. For a tool that presumably provides guidance on complex MCP server integration, this leaves too many unanswered questions.

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 the single parameter 'lastTool' documented as 'Name of the last tool that was executed'. The description adds no additional parameter information beyond what's already in the schema. According to the scoring rules, when schema description 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.

Purpose3/5

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

The description states the tool 'Get recommendations for integrating the result of the last operation with other MCP servers', which provides a general purpose (getting integration recommendations) but is vague about what specific resources or data it operates on. It doesn't clearly distinguish this from sibling tools like 'dhis2_get_composition_examples' or 'dhis2_export_for_composition', leaving ambiguity about what makes this tool unique.

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's no mention of prerequisites (e.g., needing to have executed a previous operation), nor does it differentiate this from similar-sounding sibling tools like 'dhis2_get_composition_examples'. The agent receives no help in determining the appropriate context for invoking this tool.

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