Skip to main content
Glama

dhis2_clear_audit_log

Clear the DHIS2 audit log to remove old audit records and manage system storage. Requires confirmation before execution.

Instructions

Clear the audit log (requires confirmation)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmedNoSet to true to confirm clearing the audit log

Implementation Reference

  • The main handler for the 'dhis2_clear_audit_log' tool. It calls auditLogger.clear() to empty the audit log and returns a success confirmation message.
    case 'dhis2_clear_audit_log':
      auditLogger.clear();
      
      return {
        content: [{
          type: 'text',
          text: `🗑️ Audit log cleared successfully.`
        }]
      };
  • The clear() method of AuditLogger class that implements the core logic by resetting the entries array to empty and logging the action.
    clear(): void {
      this.entries = [];
      console.log('[AUDIT] Audit log cleared');
    }
  • Global singleton instance of AuditLogger used by the tool handler.
    // Global audit logger instance
    export const auditLogger = new AuditLogger();
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions 'requires confirmation' which hints at a safety mechanism, but doesn't disclose critical behavioral traits: whether this is destructive (likely yes, given 'clear'), irreversible, requires specific permissions, or has side effects. The description is insufficient for a mutation tool with zero annotation coverage.

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 zero waste. It's front-loaded with the core action and includes essential context ('requires confirmation') without unnecessary elaboration.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks information about what 'clear' entails (e.g., permanent deletion, truncation), potential impacts, error conditions, or return values. The confirmation requirement is helpful but insufficient for full context.

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?

Schema description coverage is 100%, so the schema fully documents the single parameter 'confirmed'. The description adds no additional parameter semantics beyond implying confirmation is needed, which aligns with the schema. 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 action ('Clear') and resource ('audit log'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'dhis2_export_audit_log' or 'dhis2_get_audit_log' beyond the verb, missing explicit sibling distinction.

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

Usage Guidelines4/5

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

The description provides clear context with 'requires confirmation', indicating a prerequisite for use. It doesn't explicitly mention when not to use or name alternatives like export or get audit log tools, but the confirmation requirement offers practical 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