Skip to main content
Glama

dhis2_export_audit_log

Export complete audit logs as JSON for compliance reporting and system monitoring in DHIS2 health information systems.

Instructions

Export complete audit log as JSON for compliance reporting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'dhis2_export_audit_log' tool within the main tool call switch statement. It invokes the auditLogger's exportAuditLog method and formats the response.
    case 'dhis2_export_audit_log':
      const exportData = auditLogger.exportAuditLog();
      
      auditLogger.log({
        toolName: name,
        parameters: {},
        outcome: 'success',
        dhis2Instance: dhis2Client?.baseURL,
        userId: currentUser?.username,
        executionTime: Date.now() - startTime
      });
      
      return {
        content: [{
          type: 'text',
          text: `📤 Audit Log Export\n\n${exportData}`
        }]
      };
  • The AuditLogger class method that generates a JSON string containing the audit entries, summary, and export timestamp. This is called by the tool handler.
    exportAuditLog(): string {
      return JSON.stringify({
        exportTimestamp: new Date().toISOString(),
        entries: this.entries,
        summary: this.getAuditSummary()
      }, null, 2);
    }
  • The exported singleton instance of AuditLogger used throughout the application, including by the tool handler.
    export const auditLogger = new AuditLogger();
  • src/index.ts:106-110 (registration)
    The ListToolsRequestSchema handler filters available tools based on permissions. The 'dhis2_export_audit_log' tool is included in the 'tools' array from createDevelopmentTools() and made available here.
    const filteredTools = PermissionSystem.filterToolsByPermissions(tools, userPermissions);
    
    return {
      tools: filteredTools,
    };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'Export' and 'JSON', implying data retrieval and formatting, but doesn't disclose behavioral traits such as whether this is a read-only operation, potential data size/performance impacts, authentication requirements, rate limits, or what 'complete' entails (e.g., all records vs. filtered). For an export tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 front-loads key information: action, resource, format, and purpose. Every word earns its place with no waste, making it easy to parse quickly. It's appropriately sized for a simple tool.

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?

Given the tool's complexity (export operation with no parameters) and lack of annotations/output schema, the description is minimally adequate. It covers what the tool does but lacks details on behavioral aspects like data scope, performance, or output format beyond 'JSON'. For compliance reporting, more context on data completeness or limitations would be helpful, but it meets basic requirements.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate. A baseline of 4 is applied as it effectively handles the zero-parameter case without redundancy or omission.

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 ('Export') and resource ('complete audit log') with a specific format ('as JSON') and purpose ('for compliance reporting'). It distinguishes from sibling tools like 'dhis2_get_audit_log' and 'dhis2_get_audit_summary' by emphasizing export functionality rather than retrieval or summary. However, it doesn't explicitly differentiate from 'dhis2_export_for_composition', which is a different export type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context ('for compliance reporting'), suggesting this tool is for generating reports rather than real-time monitoring. It doesn't provide explicit guidance on when to use this versus alternatives like 'dhis2_get_audit_log' or 'dhis2_get_audit_summary', nor does it mention prerequisites or exclusions. The context is clear but lacks comparative guidance.

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