Skip to main content
Glama
log-10x

Log10x MCP Server

Official

Extract templates

log10x_extract_templates
Read-onlyIdempotent

Extracts structural log templates from local log lines using an in-process Log10x pipeline, returning template hashes and event counts for pattern cataloging and validation.

Instructions

Extract the structural template library from a set of log lines by running a local Log10x pipeline on the user's machine. Returns per-template records (the engine-internal templateHash + the template body with variable slots) and event count. Companion to log10x_resolve_batch: both tools answer 'can you run log10x locally / templatize these events'. Does NOT need Kubernetes, a deployed Reporter, or a Log10x account; the pipeline runs in-process on the host via either a locally-installed tenx binary or a docker run log10x/pipeline-10x container. Use for: (a) bootstrapping a pattern catalog before wiring up a Reporter, (b) offline auditing of stored log files, (c) validating that a config change produces expected template identities. Validation mode: pass expected.min_templates, expected.required_patterns, and/or expected.forbidden_merges to turn extraction into assertion-checked validation, each assertion reports PASS/FAIL in the output. REQUIRES a local engine: the tenx binary on PATH, or Docker with LOG10X_TENX_MODE=docker. No preflight checks for it: log10x_doctor does not probe the engine.

Input Schema

NameRequiredDescriptionDefault
pathNoLocal file path or glob when source=file.
textNoRaw text blob when source=text.
viewNosummary returns the typed envelope (data.templates[], data.event_count, data.assertions, data.human_summary). The deprecated markdown view was removed; data.human_summary carries the prose distillation for chat rendering.summary
top_nNoMax templates to return.
eventsNoInline log lines when source=events.
sourceYesInput mode. `file`: read from a local path/glob. `events`: array of raw log lines. `text`: newline-separated log events as a single string.
expectedNoOptional assertions: turns extraction into validation. Each assertion reports pass/fail in the output.

Output Schema

NameRequiredDescriptionDefault
dataNo
toolYes
viewNosummary
imagesNo
actionsNo
summaryYes
warningsNo
truncatedNo
next_cursorNo
render_hintNo
generated_atYes
schema_epochYes
schema_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.30.8
    • changedInput schema / properties / expected / description
      Previous value: -"Optional assertions — turns extraction into validation. Each assertion reports pass/fail in the output."New value: +"Optional assertions: turns extraction into validation. Each assertion reports pass/fail in the output."
  2. First observedv1.30.7

TDQS

A4.9/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, openWorld), and the description adds substantial context beyond them: no Kubernetes, deployed Reporter, or account required; execution is in-process via a tenx binary or docker container; and a REQUIRES-a-local-engine constraint with a warning that log10x_doctor does not preflight it. That missing-preflight disclosure is genuinely non-obvious and actionable.

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?

Long but front-loaded and dense with zero filler: core action first, then companion relationship, then environment requirements, then use cases, then validation mode and the engine constraint. Every sentence carries distinct, decision-relevant information.

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

Completeness5/5

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

With an output schema present and 100% param coverage, the description supplies what structured fields cannot: the local-engine requirement, the no-preflight caveat, validation semantics, and the sibling relationship. Nothing needed to invoke this correctly is missing.

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 coverage is 100%, so the baseline is 3; the description still adds value by explaining the expected.min_templates / required_patterns / forbidden_merges block as an assertion mechanism whose results surface as PASS/FAIL in output, and by clarifying that each view yields a typed envelope. It stops short of explaining every parameter, but covers the semantically tricky one.

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?

Specific verb+resource: 'Extract the structural template library from a set of log lines', plus the mechanism (local Log10x pipeline) and the exact return shape (per-template records with templateHash + body, event count). It explicitly names its sibling log10x_resolve_batch and the shared question both answer, so an agent can distinguish it without opening schemas.

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

Usage Guidelines5/5

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

Enumerates three concrete use cases: (a) bootstrapping a pattern catalog, (b) offline auditing of stored logs, (c) validating config changes. It also states the precondition that turns extraction into validation (pass expected.*) and names log10x_resolve_batch as the companion. When-to-use and how-to-select are both explicit.

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