Skip to main content
Glama
Log Detective MCP

Log Detective MCP

Official
by fedora-copr

extract_python_tracebacks

Extracts complete Python tracebacks from log text, files, or URLs using heuristics and truncates each to a set length, optionally adding surrounding context.

Instructions

Extract Python tracebacks using specialized heuristic.

Analyzes log text and extracts unbroken Python tracebacks.
Traces are truncated to `max_traceback_len` characters.

Exactly one of log_text, log_path, or log_url must be provided.

Downloaded inputs are limited to 100 MB.
Compressed files (.gz, .bz2, .xz, .zip, .tar, .tar.gz, .tar.bz2,
.tar.xz) are decompressed transparently. Archives must contain
exactly one file. Compression ratios above 100:1 are rejected.

Args:
    log_text: Raw log text to analyze.
    log_path: Path to a log file on disk.
    log_url: HTTP(S) URL to fetch log content from.
    max_traceback_len: Maximum character length per extracted traceback.
    skip_patterns: Optional list of regex patterns.
        Chunks matching any pattern are excluded.
    context: Number of lines to include before and after each traceback (0-50).
        These lines are additional to max_traceback_len. A truncated
        traceback keeps its shortened text; following context begins after
        the original traceback ends.

Input Schema

NameRequiredDescriptionDefault
contextNoNumber of surrounding lines to include.
log_urlNo
log_pathNo
log_textNo
skip_patternsNo
max_traceback_lenNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.7.0
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "log_text": {
      +        "minLength": 1
      +      }
      +    },
      +    "required": [
      +      "log_text"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "log_path": {
      +        "minLength": 1
      +      }
      +    },
      +    "required": [
      +      "log_path"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "log_url": {
      +        "minLength": 1
      +      }
      +    },
      +    "required": [
      +      "log_url"
      +    ]
      +  }
      +]
    • addedInput schema / properties / skip_patterns / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / skip_patterns / default
      Previous value: -[]New value: +null
    • removedInput schema / properties / skip_patterns / items
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / skip_patterns / type
      Removed value: -"array"
  2. Changed1 schema field changedv0.6.1
    • addedInput schema / properties / context
      Added value: +{
      +  "default": 0,
      +  "description": "Number of surrounding lines to include.",
      +  "maximum": 50,
      +  "minimum": 0,
      +  "title": "Context",
      +  "type": "integer"
      +}
  3. First observedv0.5.2

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 burden and does so well: it discloses truncation to max_traceback_len, a 100 MB download cap, transparent decompression of listed formats, and a 100:1 compression-ratio rejection rule. It does not state failure behavior (invalid regex, missing file, malformed archive), which is the main remaining gap for a no-annotation tool.

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?

Front-loaded with purpose, then constraints, then an Args block — every sentence carries information an agent would otherwise have to guess. The compression paragraph is long but each clause is a distinct, enforceable rule rather than filler.

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?

An output schema exists, so return values need not be described, and the description instead covers input acquisition, decompression, truncation, and context semantics. The one genuine omission is sibling differentiation against extract_log_snippets, which matters for a tool with a similar name and adjacent purpose.

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?

Schema description coverage is only 17%, so the Args block is doing real work: it defines log_text/log_path/log_url, skip_patterns regex exclusion semantics, and the 0-50 context range. The context note that surrounding lines are additional to max_traceback_len and that truncated tracebacks resume context after the original end adds genuine meaning unavailable in the schema.

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 opens with a specific verb+resource ('Extract Python tracebacks') and restates it in more operational terms ('Analyzes log text and extracts unbroken Python tracebacks'), so an agent immediately knows what comes back. It never names or distinguishes itself from the sibling extract_log_snippets, leaving the boundary between traceback extraction and snippet extraction implicit.

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 constraint 'Exactly one of log_text, log_path, or log_url must be provided' and through the skip_patterns/context definitions, which suggest filtering and context-expansion use cases. However, there is no explicit when-to-use statement and no mention of when to prefer the sibling extract_log_snippets over this tool.

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

Deploy Server

Other Tools