Skip to main content
Glama

log_sanitize

Sanitizes build, test, and terminal outputs by stripping ANSI noise, collapsing routine compiler messages, and isolating failure stack traces to prevent token flooding in AI context.

Instructions

Sanitize build, test, or terminal command outputs. Strips ANSI noise, collapses routine compiler stdout, and isolates actionable failure stack traces to protect context window from token flooding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exitCodeNo
maxCharsNo
rawOutputYes
projectRootNo
taskContextIdNo
includeStructuredNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.3
    • addedInput schema / properties / projectRoot
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / taskContextId
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden of behavior disclosure. It does a solid job by naming three specific transformations (strips ANSI, collapses compiler stdout, isolates stack traces) and the rationale (preventing token flooding). It does not mention return format, potential loss of information, or side effects, but the core behavior is transparent enough.

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?

Two sentences deliver the purpose, specific behavior, and rationale without redundancy. The key verb and resource are front-loaded, and every phrase adds value. This is an appropriately sized and well-structured description.

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?

The tool has six parameters, no output schema, and no annotations, yet the description explains only the general purpose. It leaves critical usage details unstated, such as what each parameter controls, what the return value looks like, and whether the tool mutates inputs or produces a new sanitized string. For an agent to invoke it correctly with full parameter awareness, this is insufficient.

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

Parameters2/5

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

Schema description coverage is 0%, and the description only hints at 'rawOutput' implicitly. It does not explain exitCode, maxChars, projectRoot, taskContextId, or includeStructured. An agent could infer rawOutput but would have no guidance for the other five parameters, especially maxChars and includeStructured, whose semantics are not obvious from names alone.

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?

The description uses a specific verb ('Sanitize') plus a clear resource ('build, test, or terminal command outputs'), and enumerates concrete actions: strips ANSI noise, collapses routine compiler stdout, isolates actionable stack traces. This makes the tool's purpose unmistakable and distinct from any sibling tool in the list.

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 clearly states the intended input type ('build, test, or terminal command outputs') and the goal of protecting the context window, which implies when to use it. However, it does not explicitly mention alternatives or when not to use it. There are no sibling sanitization tools, so the context is strong enough for a 4 rather than a 5.

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