Skip to main content
Glama
log-10x

Log10x MCP Server

Official
by log-10x

Extract templates

log10x_extract_templates
Read-onlyIdempotent

Extract structural log templates locally using a Log10x pipeline, returning template hashes and event counts. Optionally validate pattern extraction with assertions.

Instructions

Extract the structural template library from a log corpus 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 archived log corpora, (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

TableJSON 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

TableJSON 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. First observedv1.30.7

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, idempotentHint), and the description adds substantial operational context: it runs in-process on the host, requires the tenx binary on PATH or Docker via LOG10X_TENX_MODE=docker, and warns that log10x_doctor does not preflight the engine. It stops short of describing failure modes or rate/scale limits, so it lands just below the top mark.

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?

Front-loaded with purpose and mechanism, then use cases, then validation mode, then prerequisites. Dense and well-organized, though the baroque bolding and backtick-heavy formatting make it longer than strictly necessary for an agent to parse the core contract.

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?

An output schema exists so return values need little prose, yet the description still names the returned fields and covers the prerequisite engine setup, the sibling relationship, and the validation variant. For a 7-parameter tool with a nested expected object, nothing an agent needs to invoke it 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, but the description adds real meaning: it explains the validation assertion trio (expected.min_templates, required_patterns, forbidden_merges) and their PASS/FAIL output, plus the view=summary envelope contents. That is genuine value beyond the schema text.

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 specific verb and resource — 'Extract the structural template library from a log corpus' — and immediately narrows the mechanism ('RUNNING A LOCAL LOG10X PIPELINE'). It explicitly differentiates from the sibling log10x_resolve_batch, so an agent can route between them without opening either schema.

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?

Gives three concrete when-to-use scenarios (bootstrapping a catalog, offline auditing, validating config changes) plus a named companion/alternative tool. It also states what is NOT required (Kubernetes, Reporter, account), which removes a false blocker an agent might otherwise assume.

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