Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP tool reference

Every tool an AI client sees when it connects to TKTail (TKTail.exe mcp --stdio). What they are for, how to turn AI access on and what an assistant can and cannot reach: AI integration (MCP). Tools only read, except those marked Changes data - each kind needs its own permission (What AI clients may change). Every answer, an error too, starts with source: the TKTail that produced it - its node and run (Which TKTail answered). The same reference for agents and tools, as JSON: /ai/mcp-tools.json (AI agents).

43 tools.

Status and sources

tktail_status

Call this first. Tells which TKTail you are connected to and what it can do now: version and build, whether a TKTail window answers (its open logs and current context are available) or this is a standalone process with no window, the instance and its role, the license edition and its capabilities, whether Windows Event Log and Metrics are available, how many sources are open, and the size limits of the answers; broker: which TKTail carries answers (the main window for its group) and over which transport. Every answer of every tool starts with source: the TKTail that produced it (nodeId, instanceId). Read-only.

Read-only · answers without a running TKTail window too

No arguments.

tktail_list_instances

Lists the windows of this TKTail: the main window (Primary - the one whose state the other tools report) and its linked windows, each with its own source (its node and run - not the main window’s), its number, title, the sources it shows and the one in front. Linked windows’ current context is not available yet. Read-only.

Read-only · answers without a running TKTail window too

No arguments.

tktail_list_sources

Lists the investigation sources open in the TKTail window: log files, Windows Event Logs (channels or saved .evtx files) and Metrics Views (Windows Performance Counters). Each has a sourceId (valid while this TKTail runs), its kind, a display name, semantic capabilities (records, text search, structured fields, semantic time, live, metric samples) and kind-specific metadata - for a file its path, format, encoding, size, the time range of its records as far as already read and how a rotation is followed (rotation: same-name, or a dated series - app_2026-10-14.log then app_2026-10-15.log as one log: its pattern, the LIVE file and the one it moved from, whether this file is a previous one kept open); for an event log its channel or file and its ingestion (LIVE health and lag, rows evicted by retention, events skipped to stay current, gaps in the source, the newest gap markers - known gaps are evidence); for metrics the counters (English names - language-independent), aliases and the interval. No file or event contents. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
kindsarrayOnly these kinds (default: all).
limitinteger1..500At most this many sources (default 200).

tktail_get_current_context

Retrieves the evidence the user is focused on in the TKTail window right now - what they are looking at. For a log file: the source, the caret position (line, column, byte offset) and the whole logical record containing it (a multi-line entry such as a stack trace is one record, also when the caret is on a continuation line): its line range, semantic timestamp, severity, parsed fields with their roles, Summary, text and an evidenceRef. For a Windows Event Log: the selected event’s channel, provider, event ID, level, time, process / thread, message and evidenceRef. For a Metrics View: the selected series (English counter name, alias, unit, latest value and quality), the cursor time or selected range. Returns contextKind “none” with a reason when nothing is focused or no TKTail window runs. Next: tktail_get_records_around (what happened before / after), tktail_search (other records with the same request ID). Text and fields are bounded (maxTextBytes, maxFields, maxFieldBytes); what was cut is marked truncated. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
maxTextBytesinteger0..65536The record’s text, at most this many UTF-8 bytes (default 16384; 0: no text).
maxFieldsinteger0..256At most this many parsed fields (default 64).
maxFieldBytesinteger64..8192Each field value, at most this many UTF-8 bytes (default 2048).

tktail_open_source

Opens a file below an Investigation Root as a TKTail source (a tab the user sees) and returns its sourceId - then its records, records around a line or a time, and searches work as for any open source. Only below an enabled root (the path is checked in its final form: “..”, other spellings and links that lead out are refused - scope_not_allowed), never a binary file, never a folder. An open file answers with its sourceId (alreadyOpen).

Read-only · needs Trial or Pro (Extended AI investigation (MCP)) · opens the file as a paused tab in the window

ArgumentTypeRequiredBoundsDescription
pathstringyesAn absolute file path from tktail_discover_files.

tktail_get_source_sample

A bounded raw sample of an open log file: its logical records as the format in force frames them (a multi-line entry is one record; Plain Text: one line each), each with its line number, line count, byte offset and raw text - for understanding a log’s layout or writing a format profile for it. from: start (default) or end; or line: N. records 1-200 (20), maxRecordBytes 64-16384 (4096), maxBytes 1024-65536 (16384) in all; truncated / reachedStart / reachedEnd say what is missing. Open sources only. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
sourceIdstringyesAn open log file (tktail_list_sources).
fromstringstart / end
lineinteger1..
recordsinteger1..200
maxRecordBytesinteger64..16384
maxBytesinteger1024..65536

Records

tktail_get_record

Retrieves one logical record (one log entry - a multi-line entry such as an exception with its stack trace is one record) or one event, with its line range, semantic time, severity, parsed fields, Summary and bounded text - read exactly as TKTail’s RECORD pane reads it. Name it by an evidenceRef (from the current context, a search result or another record), or by a sourceId with a line, a byteOffset (files) or a recordId (events). A line inside a record returns the whole record and says which of its lines was asked for (lineInRecord). A reference made before the file was rotated, truncated or replaced is refused as stale_source - never resolved into other bytes. Only sources open in TKTail. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
evidenceRefobjectA record or event reference exactly as TKTail returned it (current context, a search result, another record) - pass it back unchanged.
sourceIdstringAn open source (tktail_list_sources), with line, byteOffset or recordId.
lineinteger1..A 1-based line of a file: the record containing it.
byteOffsetinteger0..A byte position in a file: the record containing it.
recordIdinteger0..An event’s EventRecordID (event log sources).
maxTextBytesinteger0..65536The record’s text, at most this many UTF-8 bytes (default 16384).
maxFieldsinteger0..256At most this many parsed fields (default 64).
maxFieldBytesinteger64..8192Each field value, at most this many UTF-8 bytes (default 2048).

tktail_get_records_around

Retrieves the logical records before and after an anchor - what happened just before and after an error - in the order they are in the source (never re-sorted by time; each record has its own semantic time). The anchor is the user’s current record (the default), an evidenceRef (a search result, a record), or a sourceId with a line, byteOffset, recordId or time. With a time, the record nearest that time (as TKTail’s Go To Time finds it, out-of-order times included) is the anchor; when TKTail has read only part of the file’s times, the answer says so (nearestScope “indexedPart”) - “indexTimes”: true reads the rest in the background. Each record is compact: evidenceRef, lines, time, severity, title, a few fields and a bounded text (use tktail_get_record for all of one record). With beforeSeconds / afterSeconds (0-3600): the records whose time is within that window of the anchor’s (an undated record between is kept; the anchor must have a date and time), at most before / after (default 50) per side - window.completeBefore / completeAfter say whether the window’s edge was reached. Bounded: at most 50 per side and the response budget; returnedBefore / returnedAfter, reachedStart / reachedEnd and truncated say what came back. Read-only.

Read-only · indexTimes: true starts a background time index of the source

ArgumentTypeRequiredBoundsDescription
anchorstringcurrentThe record the user is on (the default when no other anchor is given).
evidenceRefobjectA record or event reference exactly as TKTail returned it (current context, a search result, another record) - pass it back unchanged.
sourceIdstringAn open source, with one of line, byteOffset, recordId or time.
lineinteger1..
byteOffsetinteger0..
recordIdinteger0..
timestring“2026-10-06T04:49:10” (wall clock, as most logs write it) or with “Z” / an offset (an instant).
beforeinteger0..50Records before the anchor (default 5).
afterinteger0..50Records after the anchor (default 5).
beforeSecondsinteger0..3600A time window: the records up to this many seconds before the anchor’s time.
afterSecondsinteger0..3600… and after it.
maxTextBytesinteger0..8192Each record’s text, at most this many UTF-8 bytes (default 512).
maxFieldsinteger0..64Fields per record (default 8).
maxFieldBytesinteger64..2048Each field value, at most this many UTF-8 bytes (default 256).
indexTimesbooleanWith time: let TKTail read the file’s remaining record times in the background (default false).

Searches the sources open in TKTail with a TKTail search definition - the model of TKTail’s Advanced Search, not a query language: “sources” ({“kind”:“open”} = every open file and event log; {“kind”:“source”,“path”:“<sourceId>”} = one open source; {“kind”:“session”,“session”:N} = the results of an earlier search) and a “predicate”: {“all”:[…]} / {“any”:[…]} of {“text”:“timeout”} (literal; “case”:true matches case), {“regex”:“conn(ection)? refused”} (tktail-regex-1: PCRE2 with Unicode, bounded), {“field”:{“name”:“requestId”,“op”:“eq”,“value”:“ABC123”}} (op: exists eq ne contains startsWith endsWith gt ge lt le missing isNull isNotNull; “case”:true), {“time”:{“from”:“2026-10-06T04:00:00”,“to”:“2026-10-06T05:00:00”}} (wall clock; “Z” for UTC) or {“time”:{“last”:3600}}. Prefer a field condition when the format has the field (level, requestId, sc-status) - text or regex for free text. SEQUENCES (ordered relationships in time - X, then within a window Y): add “sequence”:{“steps”:[{“sources”:[0],“predicate”:{“all”:[…]}},{“sources”:[1],“predicate”:{…},“window”:{“after”:“previous”,“earliestMs”:0,“latestMs”:10000}}],“correlation”:[{“name”:“requestId”,“compare”:“exact”,“steps”:[{“input”:“field”,“field”:“requestId”},{“input”:“message”,“extract”:“after”,“text”:“requestId=”}]}],“policy”:“earliest”} - 2 to 8 steps; a step’s sources are indexes of “sources” (none: all); windows are inclusive delays after the previous step’s member (latest at most one day); correlation (optional, up to 4 key parts) maps each step’s value: input field / message / line, extract whole / regex (“pattern” + “group”: a named capture) / after (“text”) / delimited / substring / pathSegment / queryParam, normalize trim / lower / upper / removePrefix / number; compare exact / ignoreCase / number. Such a search returns “sequences”: each with start, end, durationMs, correlation values and its members in step order (evidenceRef, time, preview) - plus counts of anchors, candidates, comparisons, undated and missingKey items. Starts a search and waits up to waitMs (default 2000) for it: state, counts and the first results, each with an evidenceRef for tktail_get_record / tktail_get_records_around. Still running: tktail_get_search, page with tktail_get_search_results. evidenceMayBeMissing is true unless the search completed with every result stored - incomplete, failed and cancelled searches say why. Folders and paths not open in TKTail are refused (the Safe Workspace) - with Extended Investigation a {“kind”:“folder”,“path”:…} below an Investigation Root is searched (links not followed); open a single file first with tktail_open_source. Read-only; the search is listed in TKTail’s Search Results, marked AI.

Read-only · a folder scope below an Investigation Root: Trial or Pro (Extended AI investigation (MCP)) · starts an AI search session, shown in Search Results and Jobs (at most 5 kept)

ArgumentTypeRequiredBoundsDescription
definitionobjectyesA TKTail search definition: {“sources”:[{“kind”:“open”}],“predicate”:{…}} (schemaVersion and regexDialect may be omitted).
waitMsinteger0..5000Wait up to this long for the search to finish (default 2000).
maxResultsinteger0..100Results in this answer (default 20; 0: none).
withFieldsbooleanEach file result with its record’s severity and first fields (default false).

Without searchId: the searches TKTail keeps - the user’s and AI clients’ - newest first, one line each. With searchId: its state (running, completed, incomplete, cancelled, failed), whether evidence may be missing and why, counts (matches found, results stored, sources, records scanned), progress; waitMs waits up to 5 s for a running search; maxResults > 0 adds a page of results. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
searchIdinteger1..
waitMsinteger0..5000Wait up to this long for a running search (default 0).
maxResultsinteger0..100Results to include (default 0).
offsetinteger0..
withFieldsboolean

tktail_get_search_results

One page of a search’s results (maxResults, default 20, at most 100) from offset - for a sequence search whole sequences (start, end, durationMs, correlation, members in step order), otherwise per result its source, the logical record and the line that matched (files: recordStart, line, the match’s bytes; events: record ID, event ID, level, provider), its semantic time, a bounded preview and an evidenceRef - pass it to tktail_get_record or tktail_get_records_around. withFields adds each record’s severity and first fields. nextOffset / hasMore page on; a result whose file changed since the search is stale (no evidenceRef). Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
searchIdintegeryes1..
offsetinteger0..Default 0.
maxResultsinteger1..100Default 20.
withFieldsboolean

Stops a running search an AI client started - the same as Cancel in TKTail’s Jobs; the results found so far stay, the state says cancelled. The user’s own searches cannot be cancelled here.

Read-only · stops one of the client’s own searches (the user’s searches answer not_allowed)

ArgumentTypeRequiredBoundsDescription
searchIdintegeryes1..

tktail_list_saved_searches

Lists the user’s Saved Searches - named, versioned search definitions (sequences included): id, name, description, version, what they look for and where, and whether an AI client may run them (a folder search is outside the Safe Workspace). Run one with tktail_run_saved_search; see its definition with tktail_get_saved_search. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
limitinteger1..500Default 100.

One Saved Search with its definition - TKTail’s search definition JSON, the form tktail_search takes (adapt it and search, or run it as is with tktail_run_saved_search) and its version (the expectedVersion of a change with tktail_save_search). Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
idstringyes

Runs a Saved Search as a new search of the open sources - a copy of its current version (the search remembers which Saved Search and version it came from; editing the Saved Search later changes nothing here). Then as tktail_search: state, counts, the first results with evidenceRefs. Read-only.

Read-only · starts a new AI search session from a copy of the Saved Search

ArgumentTypeRequiredBoundsDescription
idstringyes
waitMsinteger0..5000Default 2000.
maxResultsinteger0..100Default 20.
withFieldsboolean

Saves a search definition as a Saved Search (name, description, definition - what tktail_search takes), or changes one (savedSearchId with expectedVersion = the version you read; a newer version is refused: conflict). Only when the user allowed it (Settings > AI Access > Allow AI to save searches and Metric Sets). Its sources must last: open sources ({“kind”:“open”} or a sourceId - kept as the file’s path), files and folders below an approved Investigation Root - never a search session. Returns savedSearchId and version; an alert can then use the same condition.

Changes data - needs “Allow AI to save searches and Metric Sets” · paths below an Investigation Root: Trial or Pro (Extended AI investigation (MCP))

ArgumentTypeRequiredBoundsDescription
definitionobjectyes
namestringyesat most 100 characters
descriptionstring
savedSearchIdstring
expectedVersioninteger1..

Deletes a Saved Search (savedSearchId, expectedVersion = the version you read). Needs Allow AI to save searches and Metric Sets. Alerts made from it keep their own copy of the condition. Ask the user first.

Changes data - needs “Allow AI to save searches and Metric Sets”

ArgumentTypeRequiredBoundsDescription
savedSearchIdstringyes
expectedVersionintegeryes1..

Alerts and incidents

tktail_list_alerts

Lists the user’s alerts (TKTail watches files and Windows performance counters for them): alertId, alertNumber, name, enabled, kind (file / metric), severity, version (every saved change of meaning is a new version), the condition and the evidence it keeps in words, whether it is evaluated now (and why not), and its incidents (total, new = unacknowledged, the latest). Investigate an incident with tktail_list_alert_occurrences / tktail_get_alert_occurrence. Read-only; alerts change through tktail_save_alert and its siblings, only when the user allowed AI clients to manage alerts.

Read-only

ArgumentTypeRequiredBoundsDescription
limitinteger1..500Default 100.

tktail_get_alert

One alert with its definition: the condition as TKTail’s search definition JSON (the form tktail_search takes), the evidence capture policy, the behavior (intervalMs, cooldownMs - triggers within the cooldown join one incident), a metric alert’s live status (conditionTrue: true / false / unknown - an invalid sample is never a value - and the observed value) and its 10 latest incidents. “alert” is the whole definition in the form tktail_validate_alert / tktail_save_alert take (its version is the expectedVersion of a change); madeByAi says an AI client saved it. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
alertIdstring
alertNumberinteger0..

tktail_list_alert_occurrences

The incident history, newest first: each time an alert fired, the occurrence it kept - occurrenceId, the alert, the version that fired, severity, state (capturing: evidence after the trigger still being collected; complete; partial: some evidence is missing, with the reason; failed), triggeredAt (UTC), matchCount (a storm is one incident), acknowledged, pinned, the trigger text, how many evidence items and how many complete. Filters: alertId / alertNumber (a deleted alert’s incidents stay), from / to (UTC, triggered within), states, severities or minSeverity (info < warning < error < critical; “error” = error and critical), newOnly, text (in the alert name or trigger). Severity is the alert’s when the incident fired (a later edit does not change it). origin: the TKTail node and run that captured it (after a restart not the run answering; unavailable for incidents of an earlier TKTail). Paged: offset, limit (1-100, default 20), total, nextOffset. Listing reads no evidence. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
alertIdstring
alertNumberinteger0..
fromstringUTC: “2026-10-09T10:00:00Z”.
tostring
statesarray
severitiesarray
minSeverityinfo / warning / error / criticalThis severity and higher.
newOnlyboolean
textstring
offsetinteger0..
limitinteger1..100

tktail_get_alert_occurrence

One incident: the alert and the version that fired with its condition as it was then (definition JSON), the trigger - the record that matched (its text, semantic time, the match’s character ranges, source file, format, encoding) or a metric condition with the observed value and the samples it was decided on - each evidence item (file records, Event Log events, metric samples) with its state, the reason when not complete, its window, counts and notes (rotation, truncation), the capture’s diagnostics and its origin (the node and run that captured it). Read the kept evidence with tktail_get_occurrence_evidence. Evidence is what the user’s alert asked for - TKTail captured it when the alert fired, it is not re-read. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
occurrenceIdstringyes
maxTextBytesinteger256..16384The trigger record’s text, default 4096.

tktail_get_occurrence_evidence

A page of what one evidence item of an incident kept, in order: records (rel: position relative to the trigger record, -2 = two before it; the trigger marked; time, text, generation: 1 the trigger’s file, 2.. files read after a rotation or in a dated series’ next file, 0 the series’ previous file), events (recordId, time, level, eventId, provider, message) or samples (metric index and label, time UTC, value only when valid, quality), and notes (a generation’s note names its file’s path when it is another file). Paged: item (1-based, default 1), offset, limit (1-200, default 50), maxTextBytes per text (256-16384, default 4096); total, nextOffset. Read-only.

Read-only

ArgumentTypeRequiredBoundsDescription
occurrenceIdstringyes
iteminteger1..16
offsetinteger0..
limitinteger1..200
maxTextBytesinteger256..16384

tktail_validate_alert

Checks a proposed alert exactly as saving it would - the definition, the search condition, the sources and evidence it names (open sources, metrics, event log channels, files and folders below an approved Investigation Root - nothing else), the limits, the license (a Performance Counter alert needs Metrics) - and saves nothing. Use it before tktail_save_alert, also when saving is not allowed. alert: the alert file’s JSON as tktail_get_alert shows it in “alert” - name, severity (info / warning / error / critical), condition (a search definition as tktail_search takes: sources + predicate; a metric alert: sources [{kind metric, metric {object, counter, instance}}] and predicate {all:[{metric:{source:0, op gt/ge/lt/le, value, aggregate latest/avg/min/max, windowMs, forMs}}]}), trigger {kind everyMatch / firstMatch / oncePerInterval / aggregate, intervalMs, cooldownMs}, actions (notify, tray, sound, foreground), detail (matchingText / ruleNameOnly), capture {items: [{kind file, recordsBefore, recordsAfter, beforeMs, afterMs, path (omit: the trigger’s file)}, {kind eventLog, path channel, beforeMs, afterMs}, {kind metrics, set builtin:host, beforeMs, afterMs}]}; omitted members take defaults. Returns valid, problem, whether the live runtime would evaluate it (notEvaluatedBecause), the normalized alert.

Read-only · a metric alert or metric evidence: Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
alertobjectyesThe proposed alert definition (JSON).

tktail_save_alert

Creates an alert, or changes one (alertId or alertNumber, with expectedVersion = the version you read - a version the user changed since is refused: conflict). Only when the user allowed it (Settings > AI Access > Allow AI to manage alerts; otherwise not_allowed). Checked as tktail_validate_alert: sources and evidence only from what TKTail may read for AI clients. The alert is saved as the user’s alerts are (Manage Alerts shows it at once), marked as made by an AI client; one that needs an Investigation Root is disabled when the user removes that root. Returns alertId, alertNumber, version, whether it is evaluated. Ask the user before saving.

Changes data - needs “Allow AI to manage alerts” · a metric alert or metric evidence: Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
alertobjectyes
alertIdstring
alertNumberinteger1..
expectedVersioninteger1..Changing an alert: the version you read.

tktail_set_alert_enabled

Enables or disables an alert (alertId or alertNumber, expectedVersion = the version you read). Needs Allow AI to manage alerts. Disabling stops it at once; its incidents stay.

Changes data - needs “Allow AI to manage alerts”

ArgumentTypeRequiredBoundsDescription
alertIdstring
alertNumberinteger1..
enabledbooleanyes
expectedVersionintegeryes1..

tktail_delete_alert

Deletes an alert (alertId or alertNumber, expectedVersion = the version you read). Needs Allow AI to manage alerts. Its incidents and the alert history stay. Ask the user first.

Changes data - needs “Allow AI to manage alerts”

ArgumentTypeRequiredBoundsDescription
alertIdstring
alertNumberinteger1..
expectedVersionintegeryes1..

Metrics

tktail_list_metrics

Lists every metric TKTail collects or still keeps history of (Windows performance counters the user’s Metrics Views and alerts collect): metricId, canonical English name, alias, unit, state (collecting at intervalMs, or stopped - history kept, no current value), the latest sample (time UTC, quality, value only when valid), stale, the retained history span and the Metrics Views showing it. Use a metricId with tktail_get_metric_current / _history / _summary. Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

No arguments.

tktail_get_metric_current

A metric’s latest sample: time (UTC and this machine’s local time), quality (Valid, Warmup, Missing, Denied, Error) and the value with its unit - value is null unless the sample is Valid (never a zero for a missing reading). isCurrent is true only when TKTail collects it now, the sample is valid and not stale; a stopped metric says so. Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
metricIdstringyesFrom tktail_list_metrics.

tktail_get_metric_history

A metric’s kept samples in an interval, oldest first: each {t: UTC time, v: value} - v null with q (quality) when the sample has no value; afterGap / processRestarted mark discontinuities. No interpolation: gaps (noSamples, processRestarted, noValue) are listed explicitly. The interval: from (+ to, default now), lastSeconds (default 300), or around {time, seconds} - times like “2026-10-09T10:00:00” (this machine’s wall clock, as logs write it) or with “Z” / an offset; at most 24 hours. Bounded: maxSamples (default 300, at most 2000) - truncated / nextFrom page on; for long intervals prefer tktail_get_metric_summary. historyStartsAt says when TKTail’s kept history begins (retention). Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
metricIdstringyesFrom tktail_list_metrics.
fromstringInterval start: “2026-10-09T10:00:00” (local wall clock) or with Z / an offset.
tostringInterval end (default now); only with from.
lastSecondsinteger1..86400The last N seconds (default 300).
aroundobject{“time”:“2026-10-09T10:00:15”,“seconds”:60}: N seconds on each side of a time (an error’s).
maxSamplesinteger1..2000Default 300.

tktail_get_metric_summary

Summarizes up to 16 metrics over one interval - what CPU, memory and disk did around an error: per metric min / avg / max (raw and formatted with the unit), first / last / delta, the peak and low with their times, valid samples and samples without a value (warmup, missing, denied, error), gaps and gap seconds, and historyStartsAt when the kept history begins later than the interval. Only valid samples count - nothing is assumed for gaps. metricIds: the metrics (default: every metric TKTail keeps, at most 16). The interval as tktail_get_metric_history. Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
metricIdsarrayat most 16 itemsFrom tktail_list_metrics (default: all kept, at most 16).
fromstring
tostring
lastSecondsinteger1..86400
aroundobject

tktail_list_metric_sets

Lists the Metric Sets TKTail offers - named groups of Windows performance counters: the built-in ones (Host Basics, System Pressure, Process Diagnostics, Disk & I/O, Network) and the user’s own. Each with its id, name, description, how many metrics, its binding (none; a process or an instance chosen when the user applies it), how many of its metrics TKTail collects now and how many Metrics Views show it. TKTail collects only what the user opened - an AI client reads, it never starts collection. Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

No arguments.

tktail_get_metric_set

One Metric Set with its metrics: each metric’s metricId and canonical English name (object \ counter, instance) - the identity; the alias and this Windows’s localized name are display only - its unit (unit: “%”, “bytes”, “bytes/s”, “/s”, “s” or “count”; unitKind the same as a word) and whether TKTail collects it now. Read-only.

Read-only · needs Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
idstringyesA Metric Set id from tktail_list_metric_sets (“builtin:host”, “set-…”).

tktail_save_metric_set

Saves a Metric Set of the user’s (name, description, metrics: 1-64 definitions {object, counter, instance} in English as tktail_list_metrics shows them), or changes one (metricSetId with expectedContent = its contentId as you read it; built-in sets never change). Needs Allow AI to save searches and Metric Sets, and the Metrics feature (Trial / Pro). A set is what to observe - never samples; alerts and Metrics Views use it.

Changes data - needs “Allow AI to save searches and Metric Sets” · needs Trial or Pro (Performance counters (Metrics))

ArgumentTypeRequiredBoundsDescription
namestringyesat most 64 characters
descriptionstring
metricsarrayyesat most 64 items
metricSetIdstring
expectedContentstring

tktail_delete_metric_set

Deletes a Metric Set of the user’s (metricSetId, expectedContent = its contentId as you read it). Needs Allow AI to save searches and Metric Sets. Built-in sets cannot be deleted. Ask the user first.

Changes data - needs “Allow AI to save searches and Metric Sets”

ArgumentTypeRequiredBoundsDescription
metricSetIdstringyes
expectedContentstringyes

Formats

tktail_list_formats

Lists the log formats TKTail knows - favorite (and favoriteOrder) marks the user’s favorites: the built-in ones (formatId “builtin:<key>” - JSON Lines, IIS W3C, application logs, syslog, CSV, …) with their category, family, what works for them (fields, structured search, multi-line records, live) and file extensions; and the user-defined format profiles (“custom:<id>”) with enabled, usable, state, profileVersion, framing, record types, field count and error / warning counts. kind: builtin, custom or all (default). Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
kindstringbuiltin / custom / all

tktail_get_format

One format by formatId. Built-in: its description, capabilities, extensions and notes - immutable (a user-defined profile can be made from a sample). User-defined: its state and diagnostics, field ids and field-schema fingerprint, the profile regex dialect, and its whole definition (the JSON TKTail stores - the form tktail_validate_format and tktail_preview_format take). usedBy: the open sources it is in force for. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
formatIdstringyes“builtin:<key>” or “custom:<id>” from tktail_list_formats.

tktail_detect_format

How TKTail decides a log’s format, with the actual detector. For an open source (sourceId): the format in force and how it was chosen (View As, a .tktail rule, a profile’s file association, detected, fallback), what detection alone would choose, conflicts, the resolution chain, and the detector’s candidates with confidence (0-100, level) and evidence - or why each was rejected. For your own text (sample: {text, fileName}): what TKTail would use for such a file (content and file name only). Both list the user-defined profiles whose file name or content rules claim it; with a draft definition, whether its fileMatch would. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
sourceIdstring
sampleobject
definitionobjectOptional: a draft format profile whose fileMatch to test.

tktail_preview_format

Runs a format over sample records with TKTail’s actual pipeline and shows the result per record: for a profile (a draft definition, or an installed custom:<id>) the Custom Format Studio’s preview - framing into records, outcome (match, partial, noMatch), record type (and the candidates with explain or when ambiguous), fallback, every field (id, raw, parsed, type, role, state extracted / missing / notCaptured / conditionFalse / conversionFailed, note), the Summary, issues and slow records; for a built-in (builtin:<key>) the viewer’s framing, parse and Summary. Plus totals and the definition’s diagnostics. The sample: an open source’s records (sourceId, from / line) or your own text (sample: {text, fileName}). maxRecords 1-50 (10), maxFields 1-64 (24), maxFieldBytes 64-2048 (256). Nothing is saved or applied. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
definitionobjectA draft format profile (JSON).
formatIdstringAn installed format: builtin:<key> or custom:<id>.
sourceIdstring
fromstringstart / end
lineinteger1..
sampleobject
maxRecordsinteger1..50
maxFieldsinteger1..64
maxFieldBytesinteger64..2048
explainbooleanList every record type’s candidate result.

tktail_new_format_draft

Returns a valid starting definition for a user-defined format profile. With sourceId (an open log): from that log’s detected format - a delimited log (CSV comma / semicolon, TAB, pipe) gives its own separator, quoting, header and one field per column (columns numbered from 1, in “columns”), so a profile only gives the columns their meaning (role timestamp / severity / message / correlation …, type) - one parser, nothing re-implemented. Otherwise from a template: lineBased (one record per line: timestamp, level, message), multiline (records start with a timestamp; following lines such as stack traces belong to them; the default), cloneAppLog (TKTail’s built-in application-log shape, declaratively - built-in formats themselves are immutable) or delimited (CSV / TSV / ‘;’ / ‘|’ columns: framing kind delimited with delimiter, quote, escape doubled / backslash / none, header; fields read columns by number - group 1 is the first column - or by header name). id (3-64: a lowercase letter, then a-z 0-9 . _ -) and name are optional. Nothing is saved: you keep and edit the JSON - envelope.pattern (ECMAScript with (?<name>…) groups), fields (id, group, type text / integer / decimal / boolean / timestamp / durationMs / enum, role timestamp / severity / message / logger / thread / correlation / duration / …, values), recordTypes (match / extract, fallback), framing (line / multiline with recordStart / delimited with delimiter), fileMatch (extensions, names, content) - then check it with tktail_validate_format and tktail_preview_format against the log’s own records.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
templatestringlineBased / multiline / cloneAppLog / delimited
idstring
namestringat most 100 characters
sourceIdstringAn open log the draft starts from (its detected format).

tktail_validate_format

Validates a user-defined format profile (a JSON definition: id, name, fileMatch, framing, envelope pattern, fields, recordTypes, severity, presentation - docs CUSTOM_FORMATS) with TKTail’s own parser and compiler: schema, ids and references, field types and roles, predicates and every regex (the profile dialect: ECMAScript with (?<name>…) groups, bounded as in the Custom Format Studio). Returns valid, diagnostics (severity, path such as recordTypes[1].match.pattern, message, position in the pattern), the field ids and schema fingerprint, and whether a profile with that id is installed (its version). Nothing is saved. Read-only.

Read-only · answers without a running TKTail window too

ArgumentTypeRequiredBoundsDescription
definitionobjectyesThe format profile JSON.

tktail_save_format

Saves a user-defined format profile into TKTail’s Custom Formats - only when the user allowed AI clients to save formats (Tools > Allow AI to Save Custom Formats; otherwise not_allowed - the user can import the draft in the Custom Format Studio instead). Validate and preview it first: a definition with errors is refused and nothing is written. A new id is saved as version 1; to replace an installed profile pass replacesVersion = its current profileVersion (tktail_get_format) - if it changed since, the save is refused (conflict), never overwritten. TKTail chooses where it is stored; built-in formats are never changed. applyToSourceId puts it in force for that open log (as View As, for this session). Returns the formatId, the new profileVersion, whether the field schema changed (removedFields) and warnings. favorite: true also lists it first among the user’s favorite formats - only when the user asked for that. Ask the user before saving.

Changes data - needs “Allow AI to save custom formats”

ArgumentTypeRequiredBoundsDescription
definitionobjectyesThe format profile JSON (validated again before writing).
replacesVersioninteger1..Replacing an installed profile: its current profileVersion.
applyToSourceIdstringAn open log file to use the saved profile for (View As, this session).
favoritebooleanMark it as a favorite format - only when the user asked.

Extended Investigation

tktail_list_investigation_roots

Extended Investigation: the folders the user approved for AI investigation beyond what is open in TKTail (Investigation Roots - only the user adds or enables them, in TKTail: Tools > AI Investigation Roots…). Each with its rootId, path, label, enabled and whether it is usable now. extendedInvestigation.available is false without the license capability (Trial and Pro include it) - then only the Safe Workspace (what is open) is searched. Below a usable root: tktail_discover_files, tktail_search with {“kind”:“folder”,“path”:…}, tktail_open_source. Read-only.

Read-only · to see the roots (without it the answer says Extended Investigation is not available): Trial or Pro (Extended AI investigation (MCP))

No arguments.

tktail_discover_files

Lists the files below an Investigation Root (or a folder below it) that match file masks - as a folder search would take them - each with its path, relative path, size, modified time (UTC), the format TKTail would read it as, binary (skipped by searches; not openable) and its sourceId when it is open. Links (junctions, symbolic links) are never followed or listed. Bounded: maxFiles 1-1000 (200), at most 5,000 folders listed and 10 s; truncated / incomplete / limitReason (maxFiles, maxDirectories, time) say what is missing. include / exclude: “.log;u_ex.log”, “**\archive**”; recursive (default true); probe false skips the format probe. Read-only.

Read-only · needs Trial or Pro (Extended AI investigation (MCP))

ArgumentTypeRequiredBoundsDescription
rootIdstringyesFrom tktail_list_investigation_roots.
folderstringAn absolute folder below that root (default: the root).
includestring
excludestring
recursiveboolean
maxFilesinteger1..1000
probeboolean