Skip to main content
Glama
rodhayl
by rodhayl

mcp_summarize_logs

Summarize log output to identify root causes by condensing content and highlighting errors or warnings for faster troubleshooting.

Instructions

Condense logs and highlight likely root causes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
logsYesLog output to summarize
focusNoFocus area (default: all)
maxLinesNoMaximum lines to process (default: 500)

Implementation Reference

  • The implementation of the `summarizeLogs` tool, which uses an LLM to analyze and summarize log content, highlighting errors and key events.
      async summarizeLogs(
        logs: string,
        options?: {
          focusOnErrors?: boolean;
          maxEvents?: number;
        }
      ): Promise<SummarizeLogsResult> {
        const focusOnErrors = options?.focusOnErrors ?? true;
        const maxEvents = options?.maxEvents ?? 20;
    
        const prompt = `You are an expert at log analysis. Analyze these logs and provide a summary.
    
    ${focusOnErrors ? 'Focus especially on errors and warnings.' : ''}
    Limit to ${maxEvents} most important events.
    
    Provide your response as JSON:
    {
      "summary": "High-level summary of the logs",
      "keyEvents": [
        {
          "type": "error|warning|info|event",
          "message": "Event description",
          "timestamp": "if available",
          "count": 1
        }
      ],
      "issues": [
        {
          "severity": "critical|high|medium|low",
          "description": "Issue description",
          "recommendation": "How to fix"
        }
      ],
      "statistics": {
        "totalLines": 0,
        "errorCount": 0,
        "warningCount": 0,
        "timeRange": "if determinable"
      }
    }`;
    
        try {
          const responseText = await this.llmWrapper.callToolLlm(
            'mcp_summarize_logs',
            [
              { role: 'system', content: prompt },
              { role: 'user', content: logs.substring(0, 30000) }, // Limit log size
            ],
            { type: 'summarize_logs', focusOnErrors, maxEvents }
          );
    
          const parsed = this.parseJsonResponse(responseText, {
            summary: responseText,
            keyEvents: [],
            issues: [],
          });
    
          return {
            success: true,
            summary: parsed.summary || '',
            keyEvents: (parsed.keyEvents || []).slice(0, maxEvents),
            issues: parsed.issues || [],
            statistics: parsed.statistics,
          };
        } catch (error) {
          return {
            success: false,
            summary: '',
            keyEvents: [],
            issues: [],
            error: error instanceof Error ? error.message : 'Unknown error',
          };
        }
      }
  • The type definition for the results returned by the `summarizeLogs` tool.
    export interface SummarizeLogsResult {
      success: boolean;
      summary: string;
      keyEvents: Array<{
        type: 'error' | 'warning' | 'info' | 'event';
        message: string;
        timestamp?: string;
        count?: number;
      }>;
      issues: Array<{
        severity: 'critical' | 'high' | 'medium' | 'low';
        description: string;
        recommendation?: string;
      }>;
      statistics?: {
        totalLines: number;
        errorCount: number;
        warningCount: number;
  • Registration of the `mcp_summarize_logs` tool in the discovery layer.
      'mcp_translate_code',
      'mcp_summarize_logs',
    ],
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 fails to indicate whether the tool is read-only (likely), what format the output takes, or any length/rate constraints beyond the maxLines parameter. Only the core transformation is described.

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?

Extremely concise at seven words with no filler. Front-loaded with the primary action. However, brevity comes at the cost of omitting behavioral and contextual details that would aid agent selection.

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?

Adequate for a simple 3-parameter text processing tool with no output schema, but minimal. The description covers the primary function but lacks disclosure of output format, safety characteristics, or error handling that would be expected given the absence of annotations.

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%, providing detailed descriptions for all three parameters. The description mentions 'Condense logs' which maps to the 'logs' parameter but adds no additional semantic detail beyond the schema definitions. Baseline 3 is appropriate given complete schema coverage.

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?

States specific actions (condense, highlight) and target resource (logs). The 'highlight likely root causes' clause effectively distinguishes it from the generic 'summarize' sibling and 'mcp_error_explainer' by indicating diagnostic intent.

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?

Provides no explicit guidance on when to select this tool versus siblings like 'summarize', 'mcp_error_explainer', or 'analyze_file'. While 'root causes' implies troubleshooting contexts, it does not define prerequisites or exclusions.

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/rodhayl/mcpLocalHelper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server