Skip to main content
Glama

compress_logs_and_traces

Collapses noisy CI, server, and test logs into frequency-ranked ERROR/WARN clusters and deduplicated stack traces, reducing token use for log analysis.

Instructions

Drain-style deterministic log template clusterer and stack-trace deduplicator. Normalizes timestamps, UUIDs, IPs, hex pointers, and numbers to collapse 1,000+ noisy CI/server/test lines into frequency-ranked ERROR/WARN clusters + unique stack traces (70-95% token reduction).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "logs": "<logs>"
    },
    "name": "compress_logs_and_traces"
  }
}

Input Schema

NameRequiredDescriptionDefault
logsYesRaw terminal, CI, server, Docker, or test runner log text.
maxClustersNoMaximum unique event clusters to return (default: 25).
preserveStackTracesNoExtract and deduplicate stack trace blocks verbatim (default: true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses that the algorithm is deterministic, enumerates the normalization classes applied to input, describes the output shape (frequency-ranked ERROR/WARN clusters plus deduplicated stack traces), and quantifies the expected compression. It stops short of stating that it is a pure transform with no side effects, and gives no guidance on input size limits or truncation behavior.

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?

Two dense sentences, front-loaded with the core identity before the mechanism and payoff. Nearly every clause earns its place, though 'Drain-style' is niche jargon that adds little for an agent that does not know the algorithm.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter, annotation-free, output-schema-less tool, the description supplies the essential picture: input domain, processing behavior, and what comes back. The main residual gap is operational limits (very large inputs, truncation, determinism guarantees across versions), which matter for a text-processing tool of this scale.

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 all three parameters are already documented in structured form, making 3 the baseline. The description touches indirectly on two of them ('frequency-ranked clusters' implies maxClusters, 'unique stack traces' implies preserveStackTraces) but adds no syntax, format, or trade-off detail beyond what the schema says.

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

Purpose5/5

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

States a concrete verb+resource pair ('log template clusterer and stack-trace deduplicator') plus the mechanism ('Drain-style deterministic') and the exact transform applied (normalizing timestamps, UUIDs, IPs, hex pointers, numbers). It is immediately distinguishable from siblings like compact_json_and_api or skeletonize_code, which operate on different artifacts.

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?

Usage is implied through the target corpus ('1,000+ noisy CI/server/test lines') and the benefit quantified ('70-95% token reduction'), which hints at when the tool pays off. However, there is no explicit routing guidance: no statement about when NOT to use it (e.g., short or already-structured logs), no named alternative among the sibling compaction tools, and no prerequisite conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.