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).
63 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). Which tool answers which question (per-minute counts, a process’s CPU, an event log, watching for a future condition): tktail_get_knowledge {“id”:“workflows/investigation-recipes”} - prefer TKTail’s tools to scripts and the shell for anything they cover. 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 - app.log renamed to app.log.1 - or a dated series - app_2026-10-14.log then app_2026-10-15.log as one log: followsRotation, the logicalSource, the currentGeneration and whether this source IS it, a pinnedGeneration, the history - generationsKnown, previousGenerations, licensed (series-history) - its pattern, the file it moved from; a source’s physical file changes when the log rotates: never assume its path is stable through an investigation, and a search of one source covers that generation only - the history scope covers its generations); 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
kinds | array | Only these kinds (default: all). | ||
limit | integer | 1..500 | At 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
maxTextBytes | integer | 0..65536 | The record’s text, at most this many UTF-8 bytes (default 16384; 0: no text). | |
maxFields | integer | 0..256 | At most this many parsed fields (default 64). | |
maxFieldBytes | integer | 64..8192 | Each field value, at most this many UTF-8 bytes (default 2048). |
tktail_open_source
Opens a file the user’s AI access rules allow 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 what an enabled rule allows and no exclusion covers (the path is checked in its final form: “..”, other spellings and links that lead out are refused - outside_investigation_access, never saying whether the file exists), never a binary file, never a folder. An open file answers with its sourceId (alreadyOpen). With “channel” instead of “path”: a Windows Event Log channel the user’s Event Log rules allow (“System”) opens as a tab - its history since “since” or its newest “lastEvents” (default 1000), optionally filtered by levels / providers / eventIds as tktail_query_event_log takes them, not following LIVE - so tktail_search ({“kind”:“open”} or its sourceId) finds the same request ID or time window in it beside the logs.
Read-only · opens the file - or, with “channel”, the Windows Event Log channel an Event Log rule allows - as a tab in the window (a file paused, a channel not following LIVE)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
path | string | An absolute file path from tktail_discover_files. | ||
channel | string | Instead of path: a Windows Event Log channel (“System”, “Application”) an Event Log rule allows. | ||
since | string | With channel: its events since this time (“2026-11-12T08:00:00”, local wall clock, or with Z). | ||
lastEvents | integer | 1..100000 | With channel: its newest N events (default 1000). | |
levels | array | |||
providers | array | at most 32 items | ||
eventIds |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
sourceId | string | yes | An open log file (tktail_list_sources). | |
from | string | start / end | ||
line | integer | 1.. | ||
records | integer | 1..200 | ||
maxRecordBytes | integer | 64..16384 | ||
maxBytes | integer | 1024..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. A sourceId names an open source; a search result in a file that is NOT open (a folder’s file, a compressed log such as app.log.1.gz, an earlier generation, an archive entry) has an evidenceRef naming its search: the record is read again from the file the search read (readFrom “searchedFile”; its storageKind, container and entry; identity checked - a changed file is stale_source) - Extended Investigation, the AI access rules decide again. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
evidenceRef | object | A record or event reference exactly as TKTail returned it (current context, a search result, another record) - pass it back unchanged. A search result in a file that is not open names its search (searchId, source). | ||
sourceId | string | An open source (tktail_list_sources), with line, byteOffset or recordId. | ||
line | integer | 1.. | A 1-based line of a file: the record containing it. | |
byteOffset | integer | 0.. | A byte position in a file: the record containing it. | |
recordId | integer | 0.. | An event’s EventRecordID (event log sources). | |
maxTextBytes | integer | 0..65536 | The record’s text, at most this many UTF-8 bytes (default 16384). | |
maxFields | integer | 0..256 | At most this many parsed fields (default 64). | |
maxFieldBytes | integer | 64..8192 | Each 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. A search result in a file that is not open (its evidenceRef names the search) is read from that file: before / after counts, no time window. Around the same moment in EVERY open source: tktail_search with a time predicate over {“kind”:“open”} (and tktail_query_event_log / tktail_get_metric_summary with the same window). 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
anchor | string | current | The record the user is on (the default when no other anchor is given). | |
evidenceRef | object | A record or event reference exactly as TKTail returned it (current context, a search result, another record) - pass it back unchanged. A search result in a file that is not open names its search (searchId, source). | ||
sourceId | string | An open source, with one of line, byteOffset, recordId or time. | ||
line | integer | 1.. | ||
byteOffset | integer | 0.. | ||
recordId | integer | 0.. | ||
time | string | “2026-10-06T04:49:10” (wall clock, as most logs write it) or with “Z” / an offset (an instant). | ||
before | integer | 0..50 | Records before the anchor (default 5). | |
after | integer | 0..50 | Records after the anchor (default 5). | |
beforeSeconds | integer | 0..3600 | A time window: the records up to this many seconds before the anchor’s time. | |
afterSeconds | integer | 0..3600 | … and after it. | |
maxTextBytes | integer | 0..8192 | Each record’s text, at most this many UTF-8 bytes (default 512). | |
maxFields | integer | 0..64 | Fields per record (default 8). | |
maxFieldBytes | integer | 64..2048 | Each field value, at most this many UTF-8 bytes (default 256). | |
indexTimes | boolean | With time: let TKTail read the file’s remaining record times in the background (default false). |
Windows Event Log
tktail_query_event_log
Reads events of ONE Windows Event Log channel - Application, System, an Operational log - by provider, event ID, level, text and a time window, with TKTail’s own Event Log reader: no shell, no PowerShell, no Get-WinEvent. The channel must be open in TKTail or allowed by the user’s Event Log rules (Tools > AI Access Rules… > Add Event Log; default deny; the Security log only by a rule that names it - otherwise outside_investigation_access with the operator’s action in error.details). Filters: providers ([“Service Control Manager”]), eventIds (“7031, 7034-7036, -1000” or [7036]), levels (critical, error, warning, information, verbose), text (in the message, the provider or the event ID, any case); the window: from / to (“2026-11-12T10:00:00” this machine’s wall clock, or with Z; to defaults to now) or lastMinutes (default 60) - at most 31 days, bounded by the server-side query. Returns the newest maxEvents (default 100, at most 500) of the window, oldest first: recordId, time (UTC and local), level, eventId, provider, task, message (maxMessageBytes, default 1024) - more true when the window holds more (next says how to page back); problems when part of the window is gone from the log (overwritten, cleared); access (open or the rule that allowed it) and query.id. A service restart or crash: the System log’s Service Control Manager events 7031, 7034, 7036. Read-only.
Read-only · reads events of one Windows Event Log channel in a bounded window (the user’s Event Log rules decide; the Security log only by a rule that names it) - nothing is written
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
channel | string | yes | at most 255 characters | “Application”, “System”, “Microsoft-Windows-PowerShell/Operational” - no wildcard, no path. |
providers | array | at most 32 items | Provider names (any of them). | |
eventIds | ||||
levels | array | |||
text | string | at most 200 characters | ||
from | string | Window start: “2026-11-12T10:00:00” (local wall clock) or with Z / an offset. | ||
to | string | Window end (default now). | ||
lastMinutes | integer | 1..44640 | Instead of from / to: the last N minutes (default 60). | |
maxEvents | integer | 1..500 | The newest events of the window (default 100). | |
maxMessageBytes | integer | 64..8192 | Each message, at most this many UTF-8 bytes (default 1024). |
Search
tktail_search
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. MULTI-LINE RECORDS: a text or regex condition tests one source line (the default, “scope”:“line”) - two terms on different lines of one record (an exception’s header and its stack) never match together; with “scope”:“record” it tests the WHOLE logical record as the format frames it (its lines joined with \n; a regex’s ^ / $ are the record’s start / end, (?m) for each line’s): {“all”:[{“text”:“Error deserializing json”,“scope”:“record”},{“text”:“RISK”,“scope”:“record”}]} finds the record holding both (one result, on its first line) - then read it whole with tktail_get_record. A field condition tests the record’s fields (from its first line). 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 / text (the matched line), extract whole / regex (“pattern” + “group”: a named capture) / after (“text”) / delimited (“text” + “index”) / substring / pathSegment / queryParameter (“name”), 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. COUNTS (errors per minute, top client IPs, average time-taken): add “aggregate” ({“bucket”:“1m”}, {“groupBy”:[“sc-status”]}, {“number”:“time-taken”}) - it covers EVERY match, also beyond the stored results; never page the results to count them yourself. THE SAME REQUEST ID EVERYWHERE: one search of {“kind”:“open”} (or several sources) with a field condition. EVERYTHING AROUND A MOMENT: a predicate of only {“time”:{“from”,“to”}} over {“kind”:“open”}. 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 - also a result in a folder’s file, a compressed log or an archive entry that is not open (never re-search it with a regex). 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. TKTail keeps an AI client’s newest 5 unpinned searches: an older one is closed to make room (the answer’s closedToMakeRoom; asking for it later says not_found with error.details: state, reason, closedAt) - tktail_pin_search keeps a search. Folders and paths not open in TKTail are refused (the Safe Workspace) - with Extended Investigation a {“kind”:“folder”,“path”:…} the AI access rules allow is searched (links not followed; only the files the rules allow); open a single file first with tktail_open_source. A folder’s ARCHIVE SCOPE is explicit (schemaVersion 3): its compressed logs (.gz .zst .xz .bz2 .lz4) are searched by default (“compressed”:false leaves them out); archive CONTENTS (ZIP, 7Z, RAR, TARs) only with “archives”:true - default false, narrow first with “entryInclude”:“.log”; nested archives are never searched. The answer’s “scope” says what the declared scope left out (archivesExcludedByScope + a hint): 0 matches there is 0 in that scope, not in the folder. File masks (include, exclude, entryInclude; “;” separates) know * and ? only - [ ] { } are refused (invalid_arguments, error.details.code “unsupported_mask_syntax”), never a search of zero files: write u_ex2611[5-8].log as u_ex26115*.log;u_ex26116*.log;u_ex26117*.log;u_ex26118*.log. “estimateOnly”:true returns the scope’s size and weight (names, sizes, archive directories - nothing decompressed or searched) instead of searching. Never unpack an archive yourself. Compressed history (Extended, a log the AI access rules allow; schemaVersion 3): {“kind”:“history”,“path”:<a log or its sourceId>} - the log and its numbered / dated generations, gzip, zstd, xz, bzip2 and lz4 ones included, each once (tktail_get_log_history); {“kind”:“archive”,“path”:<ZIP / TAR / TAR.GZ / TAR.ZST / TAR.XZ / TAR.BZ2 / TAR.LZ4 / 7Z / RAR - or one GZIP / ZSTD / XZ / BZIP2 / LZ4 stream>,“include”:“*.log”} or with “entry”:“var/log/app.log” - entries read where they lie (tktail_list_archive_entries); results name storageKind, archiveFormat, container and entry. Read-only; the search is listed in TKTail’s Search Results, marked AI.
Read-only · starts an AI search session, shown in Search Results and Jobs (at most 5 kept)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
definition | object | yes | A TKTail search definition: {“sources”:[{“kind”:“open”}],“predicate”:{…}} (schemaVersion and regexDialect may be omitted). A text / regex condition takes “scope”: “line” (default) or “record” (the whole logical record). A folder source takes “recursive”, “include” / “exclude” file masks, “compressed” (default true), “archives” (default false: archive contents are NOT searched unless true), “entryInclude” (entry masks with archives); “nestedArchives” is never supported. | |
estimateOnly | boolean | true: do not search - estimate the disk scopes (files, compressed logs, archives found / in scope, eligible entries, physical and known logical bytes, the weight now and with archive contents) from names, sizes and archive directories only. | ||
description | string | at most 200 characters | What the search is for (“HTTP 500 investigation”) - shown with its job in TKTail’s Jobs and tktail_list_jobs; omitted: TKTail describes it. | |
waitMs | integer | 0..5000 | Wait up to this long for the search to finish (default 2000). | |
maxResults | integer | 0..100 | Results in this answer (default 20; 0: none). | |
withFields | boolean | Each file result with its record’s severity and first fields (default false). | ||
fields | array | at most 32 items | Projection: each file result with only these fields of its record, as “values” {name: value, or null when the record has none}. | |
preview | boolean | false: no preview text in the results - smaller pages (default true). | ||
aggregate | object | Analyze EVERY match as the search finds it (also beyond the results it stores) - the answer’s “aggregate”, when the search has finished. Members as tktail_aggregate takes them. |
tktail_get_search
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | 1.. | ||
waitMs | integer | 0..5000 | Wait up to this long for a running search (default 0). | |
maxResults | integer | 0..100 | Results to include (default 0). | |
offset | integer | 0.. | ||
withFields | boolean | |||
fields | array | at most 32 items | Projection: each file result with only these fields of its record, as “values” {name: value, or null when the record has none}. | |
preview | boolean | false: no preview text in the results - smaller pages (default true). |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | yes | 1.. | |
offset | integer | 0.. | Default 0. | |
maxResults | integer | 1..100 | Default 20. | |
withFields | boolean | |||
fields | array | at most 32 items | Projection: each file result with only these fields of its record, as “values” {name: value, or null when the record has none}. | |
preview | boolean | false: no preview text in the results - smaller pages (default true). |
tktail_cancel_search
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)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | yes | 1.. |
tktail_aggregate
THE way to answer “how many per minute / per hour?” (“bucket”:“1m”), “which client, status or user most?” (groupBy + top) and “total / average time?” (number) - inside TKTail, never by paging results into a script. Analyzes the results a finished search STORED - never a rescan, the rows TKTail’s Search Results lists: “groupBy” up to 4 keys (a field name such as “c-ip” or “sc-status”, or a value mapping as in sequence correlation: {“input”:“text”,“extract”:“regex”,“pattern”:“user=(?<u>\w+)”,“group”:“u”}, {“input”:“message”,“extract”:“after”,“text”:“tenant=”}) gives the top N groups (“top”, default 10, at most 1000; “order” count / sum / max / min / avg) with counts, the first result of each (firstResultIndex for tktail_get_search_results, an evidenceRef) and the rows outside the top (otherRows); “bucket” (“1m”, “5m”, “1h”, 1 second to 1 day) adds a time histogram (UTC bucket starts; undated rows counted apart); “number” (a field such as “time-taken” or a mapping, e.g. a regex capture of “elapsed=(?<ms>\d+)ms”) adds count / sum / min / max / avg overall, per group and per bucket - a number is read exactly (“1985.000”, “-3”, “1e3”; never “1,5” or “12ms”: those are notNumbers). A row is a matched line or event (a second match on the same line is mergedMatches, never a second row). A row without a value for a groupBy key is in NO group (there is no ‘missing’ group): totalMatchedRecords, groupedRecords, missingKeyRecords and missingKeyRecordsByKey say the population - the groups add up to groupedRecords, not to every row. Without groupBy, bucket or number: the row count alone (count-only). complete is true only when the search completed with every match stored, every row read again and nothing over a bound - otherwise caveats say what the numbers cover. Waits up to waitMs (default 2000) - still running: call again with “analysisId” alone. Bounded: 10,000 distinct keys (further rows counted as untrackedRows), 10,000 buckets. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | 1.. | A finished search (tktail_search, tktail_get_search). | |
analysisId | integer | 1.. | An analysis already started: its answer (alone, with waitMs). | |
groupBy | array | at most 4 items | ||
top | integer | 1..1000 | Groups in the answer (default 10). | |
order | string | count / sum / max / min / avg | How the top groups are chosen (default count; the others need a number). | |
bucket | string | A histogram bucket: 1s to 1d (“1m”, “5m”, “1h”). | ||
number | ||||
waitMs | integer | 0..5000 | Wait up to this long for the analysis (default 2000). |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
limit | integer | 1..500 | Default 100. |
tktail_get_saved_search
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
id | string | yes |
tktail_run_saved_search
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
id | string | yes | ||
waitMs | integer | 0..5000 | Default 2000. | |
description | string | at most 200 characters | What this run is for - shown with its job (Jobs, tktail_list_jobs). | |
maxResults | integer | 0..100 | Default 20. | |
withFields | boolean | |||
fields | array | at most 32 items | Projection: each file result with only these fields of its record, as “values” {name: value, or null when the record has none}. | |
preview | boolean | false: no preview text in the results - smaller pages (default true). | ||
aggregate | object | Analyze EVERY match as the search finds it (also beyond the results it stores) - the answer’s “aggregate”, when the search has finished. Members as tktail_aggregate takes them. |
tktail_save_search
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 the AI access rules allow - never a search session; a sourceId TKTail follows as a dated series is kept as the series (“series”). Returns savedSearchId and version; an alert can then use the same condition.
Changes data - needs “Allow AI to save searches and Metric Sets”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
definition | yes | |||
name | string | yes | at most 100 characters | |
description | string | |||
savedSearchId | string | |||
expectedVersion | integer | 1.. |
tktail_delete_saved_search
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”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
savedSearchId | string | yes | ||
expectedVersion | integer | yes | 1.. |
Alerts and incidents
tktail_list_alerts
WATCHING FOR SOMETHING THAT HAS NOT HAPPENED YET (until an error appears, until CPU stays above 90 %) is an alert’s job - TKTail watches, never a loop of searches or a script: check it with tktail_validate_alert, save it with tktail_save_alert when the user allowed it (otherwise give the user the checked definition and error.details.operatorAction), read its incidents later (tktail_list_alert_occurrences). 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
limit | integer | 1..500 | Default 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alertId | string | |||
alertNumber | integer | 0.. |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alertId | string | |||
alertNumber | integer | 0.. | ||
from | string | UTC: “2026-10-09T10:00:00Z”. | ||
to | string | |||
states | array | |||
severities | array | |||
minSeverity | info / warning / error / critical | This severity and higher. | ||
newOnly | boolean | |||
text | string | |||
offset | integer | 0.. | ||
limit | integer | 1..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). “trace” says WHY it fired (absent: an incident of a TKTail that kept no trace): the condition by its stable ids (expression “C1 AND (C2 OR C3)”), activatedAt, complete (false: the causal proof is not whole - “gaps” say what is missing; the incident is then partial), and each condition - id, parent group, kind, description, result (true / false / unknown), contributed (on the causal path to the activation), and its proof: a log condition refers to the trigger record (its range in the record’s text), a metric condition carries metric, unit, op, threshold, aggregate, windowMs / forMs, observed, the window of samples it was decided on, a summary (count, min, max, avg, last) and its samples (the newest maxTraceSamples). 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
occurrenceId | string | yes | ||
maxTextBytes | integer | 256..16384 | The trigger record’s text, default 4096. | |
maxTraceSamples | integer | 0..600 | Samples per metric condition in the trace, the newest; default 120. |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
occurrenceId | string | yes | ||
item | integer | 1..16 | ||
offset | integer | 0.. | ||
limit | integer | 1..200 | ||
maxTextBytes | integer | 256..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 the AI access rules allow - 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” (the schema below lists every member and value). A file alert names its sources by sourceId; when TKTail follows that file as a dated series (tktail_list_sources file.rotation), the alert follows the series - its newest file - and the normalized alert says so (“series”); give “series” yourself for a series TKTail did not detect (u_ex{YYMMDD}.log). A metric alert: a source {kind metric, metric {object, counter, instance}} and {metric:{source:0, op, value, aggregate, windowMs | forMs}}. Omitted members take defaults. Returns valid, problem, whether the live runtime would evaluate it (notEvaluatedBecause), the normalized alert. The examples are complete.
Read-only · a metric alert or metric evidence: Trial or Pro (Performance counters (Metrics)) · an activation other than always, or onFire: Trial or Pro (Conditional and scheduled monitoring)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alert | yes |
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 - error.details names requiredPermission and the operatorAction to pass to the user). 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 reads files the AI access rules no longer allow is disabled. The alert keeps its file watched while it is enabled - also without a tab (a dated series: its newest file). 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)) · an activation other than always, or onFire: Trial or Pro (Conditional and scheduled monitoring)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alert | yes | |||
alertId | string | |||
alertNumber | integer | 1.. | ||
expectedVersion | integer | 1.. | 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”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alertId | string | |||
alertNumber | integer | 1.. | ||
enabled | boolean | yes | ||
expectedVersion | integer | yes | 1.. |
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”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
alertId | string | |||
alertNumber | integer | 1.. | ||
expectedVersion | integer | yes | 1.. |
tktail_list_activations
Why each alert and conditional monitor runs now (conditional monitoring, ADR-097): for every target - its kind (alert / monitor), id, name, its base activation (always / scheduled / whenActivated) with the schedule (time zone, recurring wall-clock windows, one-off windows in UTC), its resource class (light / moderate / heavy; heavy runs only with the user’s approval), enabled, activeNow, blocked (why it does not run although asked), every reason apart (schedule, lease - with the alert and incident that started it, until) and the next start / change. Also the conditional monitors (a Metric Set collected, or a file watched, only while active), the leases (active and ended in this run: activated, expires, refused and why - a cycle, the depth, Heavy without approval) and the activation history (window entered / exited, lease added / expired / revoked / refused). An AI client’s own bounded metric monitoring (tktail_start_metric_monitoring) is listed as a temporary monitor with an aiClient lease. Read-only: other activations start from alerts’ actions, schedules and the user; no AI client starts, extends or stops those.
Read-only · for targets to run conditionally (without it the answer says they are dormant): Trial or Pro (Conditional and scheduled monitoring)
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
history | integer | 0..500 | History events, the newest; default 50. |
Evidence
tktail_pin_search
Pins a search (pinned: true, the default) so TKTail never closes it to make room - the AI clients’ bound of 5 searches and the session limit apply to unpinned searches only. A pinned search is kept across a TKTail restart (its definition and the references of its results) and stays usable by tktail_aggregate, tktail_get_search_results and tktail_save_evidence while its files still hold the same data. At most 20 searches are pinned; beyond that the pin is refused - unpin one. Pin a search while an investigation continues; save evidence (tktail_save_evidence) when proof must survive the logs rotating or being deleted - a pin keeps references, a package keeps the bytes. An AI client may unpin only searches an AI client pinned. preserveEvidence also starts saving the results’ records as an evidence package - the strongest protection against rotation; the answer’s preservation is a capture that is still running (state capturing: NOT preserved yet - confirm with tktail_get_evidence(packageId, waitMs) until saved or failed before telling anyone it is preserved). A pinned search’s answer says its protection: preserved (a verified package exists - evidencePreserved true), preservationPending (capturing), preservationFailed (the capture failed or was cancelled - failedCapture names its failureCode; save again), sourceStillAvailable or sourceDisappeared (never a guarantee TKTail cannot give). While a capture runs, its search is never closed to make room. keptAcrossRestart: its snapshot is on disk (a finished search’s pin is answered once it is written, 3 s at most; a running search’s when it finishes). Needs Allow AI to save evidence and pin searches (off until the user turns it on).
Changes data - needs “Allow AI to save evidence and pin searches” · pins or unpins a search: a pinned search is never closed to make room and is kept across a restart (a snapshot of its references in the data folder); an AI client cannot unpin the user’s pin
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | yes | 1.. | |
pinned | boolean | true (default): pin; false: unpin. | ||
preserveEvidence | boolean | Also save the results’ records now as an evidence package (redacted), while the files still hold them. | ||
contextRecords | integer | 0..1000 | With preserveEvidence: records kept on each side of a hit (default 20). |
tktail_save_evidence
Preserves evidence as a durable, redacted, verifiable package in TKTail’s Evidence Store - only the records that matter, never a copy of a whole log. Name what: “searchId” (all its results, or the result indexes in “results”) and / or “evidenceRefs” (from search results, records, incidents). Context around each hit: “contextRecordsBefore” / “contextRecordsAfter” (logical records as the format frames them - a stack trace is one record; at most 1000) and / or “contextTimeBeforeMs” / “contextTimeAfterMs” (by each record’s own time). TKTail seeks to the hits’ stored byte offsets (no rescan), merges overlapping ranges and keeps the source bytes exactly where nothing was redacted. Correlated sources for the same time window (the hits’ span widened by the time context, 15 s when none is given) are named explicitly: “correlatedSourceIds” (other open files and event logs), “correlatedChannels” (Windows event log channels such as “Application” - open in TKTail or allowed by the user’s Event Log rules, otherwise outside_investigation_access), “correlatedMetricSets” (Metric Set ids - their kept samples). Secrets (Authorization / Bearer headers, JWTs, passwords and connection-string passwords, API keys, private keys and the user’s own rules) are redacted BEFORE anything is written - there is no unredacted option. “note” says why; “linkIncidentId” links an incident; “destination” {“folder”} also copies the package into a folder the AI access rules allow as a whole (Extended Investigation). The capture runs in the background: the answer waits up to waitMs (default 3000) and says state - saved (preserved: true, the package is written and VERIFIED), capturing (preserved: false - NOT saved yet; call tktail_get_evidence(packageId, waitMs) until the state is saved or failed, and never report evidence as saved before), failed or cancelled (preserved: false, failureCode package_write_failed / package_verify_failed / evidence_limit_exceeded / evidence_quota_exceeded / source_unavailable / capture_failed / cancelled, and the reason; nothing was preserved - tktail_list_evidence lists such captures under failed). Saved: packageId, the archive’s size and SHA-256, the time range, counts, the source bytes read (sourceBytesRead), the number of redactions and warnings (a source that changed or rotated before it could be read is reported, never guessed; nothing preserved at all is a failure). A package keeps at most 5000 hits (a search stores at most 5000 results; beyond that the manifest’s limitations say how many were kept) from any number of sources its manifest can describe (checked before anything is read: evidence_limit_exceeded says to save the results in parts). A search package also keeps the search’s SCOPE INVENTORY (scope/sources.jsonl: every source its declared scope reached - searched, incomplete, failed, skipped, excluded, not read - with its identity and match count) and says completeness: complete, or partial with partialReasons (the search incomplete or truncated, a source that changed, a file of the scope that could not be read). A finished search that found NOTHING is saved too (negative evidence: “searchId” alone) - the inventory proves what was searched; never report “no match” without its scope and completeness. Saved: completeness, scope counts (scopeSources, examinedSources, sourcesWithMatches, evidenceSources, failedSources, excludedSources), never the list itself. “fullFileSourceId” saves a whole open file instead (when a vendor asks for the whole log): redacted, compressed while it is read, paced, within the full-file limit - never a copy of a file TKTail does not have open. Needs Allow AI to save evidence and pin searches (off until the user turns it on).
Changes data - needs “Allow AI to save evidence and pin searches” · correlatedMetricSets: Trial or Pro (Performance counters (Metrics)) · writes a redacted evidence package (a ZIP) into the Evidence Store (the data folder’s Evidence folder), within its size limits; with destination also a copy in a folder the AI access rules allow
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
searchId | integer | 1.. | A finished search: its results are the hits. | |
results | array | at most 5000 items | With searchId: only these result indexes. | |
evidenceRefs | array | at most 1000 items | evidenceRef objects as TKTail returned them. | |
contextRecordsBefore | integer | 0..1000 | ||
contextRecordsAfter | integer | 0..1000 | ||
contextTimeBeforeMs | integer | 0..21600000 | ||
contextTimeAfterMs | integer | 0..21600000 | ||
correlatedSourceIds | array | at most 16 items | Open files / event logs (tktail_list_sources) for the same window. | |
correlatedChannels | array | at most 16 items | Windows event log channels by name (“Application”). | |
correlatedMetricSets | array | at most 8 items | Metric Set ids (tktail_list_metric_sets). | |
includeParsedRecords | boolean | Also records.jsonl - each record parsed, its fields (default true). | ||
note | string | at most 2000 characters | ||
linkIncidentId | string | An incident’s occurrenceId. | ||
destination | object | Also copy the package into this folder - one the AI access rules allow as a whole. | ||
waitMs | integer | 0..5000 | ||
fullFileSourceId | string | An open file (sourceId): the WHOLE file as evidence, redacted and compressed, on its own (no searchId / evidenceRefs) - only when the whole log is really asked for. |
tktail_list_evidence
The evidence packages in TKTail’s Evidence Store, newest first (offset / limit 1-100, default 20): packageId, created, note, sources (the first 16 names; sourceCount, evidenceSources, scopeSources say how many), completeness (complete, partial, notRecorded for a package of TKTail 1.2 - 1.3.0-rc.3), time range, size, hits, redacted + replacements, linked incident, the archive’s SHA-256, whether an AI client asked to delete it. Also “capturing” - captures still running (not preserved yet) - and “failed” - recent captures that ended WITHOUT a package (failed or cancelled; kept across restarts for up to 30 days, the newest 50): packageId, failureCode, reason, startedAt / endedAt, the search number of the run that asked. Only “packages” are preserved evidence. Metadata only - no evidence content. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
offset | integer | 0.. | ||
limit | integer | 1..100 |
tktail_get_evidence
One package’s manifest as a summary (created by, TKTail version, schemaVersion, completeness with partialReasons, the search’s scope as counts and the search’s state, context, time range, redaction summary per rule, sources with their state and notes - a page of them: “sourceOffset” / “maxSources” (0-500, default 50; sourceCount, nextSourceOffset), hits with their record, line when known and range, artifacts of the package and of the listed sources with size and SHA-256, limitations, the archive’s path and SHA-256) - and with “artifact” (a path from “artifacts”, or “scope/sources.jsonl”: the scope inventory, one JSON line per source) a bounded fragment of that file: “offset” / “maxBytes” (1024-65536, default 16384, whole lines where possible; nextOffset / hasMore page on). For records.jsonl, “fields” returns only those fields of each record. What is returned is the stored package - redacted when it was captured. A file larger than 64 MiB is not paged: its path is given. A capture still running: the answer waits up to “waitMs” (0-5000, default 3000) for it to end, then answers the package (state saved) - or its progress when the time ran out (state capturing, preserved false: call again; no need to wait in between). A capture that ended without a package answers state failed or cancelled, preserved false, failureCode and reason - also after a restart. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
packageId | string | yes | ||
artifact | string | |||
offset | integer | 0.. | ||
maxBytes | integer | 1024..65536 | ||
fields | array | at most 32 items | ||
maxHits | integer | 0..200 | ||
sourceOffset | integer | 0.. | ||
maxSources | integer | 0..500 | ||
waitMs | integer | 0..5000 |
tktail_verify_evidence
Reads the package’s archive and checks it: its SHA-256 against the one recorded when it was saved, the ZIP structure and CRCs, the manifest’s schema (1 or 2), every file’s presence, size and SHA-256, the manifest’s own references (every result’s source and range exist), and - schema 2 - the scope inventory recounted line by line against the manifest and a “complete” claim against its sources, results and scope. Verdict VALID, MODIFIED, INCOMPLETE or UNSUPPORTED (a newer TKTail’s package, left as it is) with the problems found, the completeness and the recounted scope. Hashes show the package is unchanged since TKTail wrote it - not who made it. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
packageId | string | yes |
tktail_delete_evidence
Asks the user to delete an evidence package: TKTail records the request and shows it in the Evidence Library, where the user confirms or rejects it - an AI client never deletes evidence itself, and the package stays until the user decides. Needs Allow AI to save evidence and pin searches. Ask the user before calling this.
Changes data - needs “Allow AI to save evidence and pin searches” · records a deletion REQUEST in the Evidence Store’s catalog and tells the user; nothing is deleted until the user confirms it in TKTail
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
packageId | string | yes | ||
reason | string | at most 500 characters |
Jobs
tktail_list_jobs
TKTail’s job history - the work it ran in the background (searches, line indexing, exports, evidence captures, incident captures, archive entries, file hashes), in this session and - kept across restarts - earlier ones, newest first, as structured records: id (the job number), uid (durable: unambiguous across sessions), session (“current”: this TKTail session; “previous”: history of an earlier one), type, title, description (and descriptionSource: given by the user / a client, or generated by TKTail), status (running, completed, incomplete, failed, cancelled; interrupted true with lastKnownState: an earlier session ended before the job’s end was recorded - status failed, no finish time), timestamps (created, started, finished - UTC), durationMs (elapsedMs while running), origin (kind user, aiClient, alert or tktail; via ui / mcp-stdio / mcp-http; the object it came from - a search, a Saved Search, an alert, an incident, a tab; request: the MCP tool an AI client called; the nodeId and instanceId of the session that ran it), scope (what it operated on, compact), result (where its outcome belongs: a search number, an evidence packageId, a file, an incident - a search number belongs to its session: a previous session’s search is gone), outcome / failureReason, warnings. Find the job your own call started: origin “aiClient”, session “current” and its result id (“resultId”: a searchId as a string, or a packageId). Filters: type, origin, status, session, resultId; offset / limit (1-100, default 20). Metadata only - never the results or the evidence; texts are redacted. The same records the Jobs view shows and exports (the newest 500 finished jobs of the last 7 days). Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
offset | integer | 0.. | ||
limit | integer | 1..100 | ||
type | string | search / index / export / evidence / incident / archive / hash / other | ||
origin | string | user / aiClient / alert / tktail | ||
status | string | running / completed / incomplete / failed / cancelled | ||
session | string | current / previous | This TKTail session’s jobs, or the history of earlier sessions. | |
resultId | string | at most 200 characters | A search number (“24”) or an evidence packageId: that job only. |
File fingerprints
tktail_hash_files
The SHA-256 of whole files - for deployment verification (is this the binary / config that was shipped?), comparing files, identifying a file in a report or evidence - computed by TKTail, no shell needed. Name the files by “paths” (absolute; Extended Investigation - only files the user’s AI access rules allow: each file is decided before it is opened, a refused one answers status “denied” with the reason and is never read; when every file is refused the call is the refusal itself) and / or “sourceIds” (files open in TKTail). The bytes are the PHYSICAL file’s (hashScope “physicalFile”): app.log.gz is the .gz on disk, never its decompressed log; an open archive entry hashes its archive file; entries are never hashed. Per file: status completed (sha256 - a fingerprint), changedDuringHash (the file grew, was written or was replaced at its path while read: no fingerprint - sha256OfBytesRead and change say what happened; hash it again when it is not being written), failed (error: not_found, access_denied, not_a_file, read_failed), denied, cancelled; with bytesHashed, size, fileIdentity, lastWriteTime, startedAt, finishedAt, durationMs. One file is read at a time; a request holds at most 100 files and 16 GB (more: resource_budget_denied - the user can hash them in TKTail). Waits up to waitMs (default 5000, at most 30000; over stdio at most 8000 - the window’s answer must cross the instance pipe in time); still hashing (state running / queued): call again with “hashId” alone. The request is listed in TKTail’s Jobs. Reads files; writes nothing.
Read-only · reads each whole file (one file at a time, in the background); the request is listed in Jobs - nothing is written
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
paths | array | at most 100 items | Absolute paths of files the AI access rules allow (tktail_discover_files lists them). | |
sourceIds | array | at most 100 items | Files open in TKTail (tktail_list_sources): their physical files. | |
hashId | integer | 1.. | An earlier request still hashing - alone (with waitMs). | |
waitMs | integer | 0..30000 | Wait up to this long for the hashes (default 5000; over stdio at most 8000). | |
description | string | at most 200 characters | What the hashes are for - shown with the job in TKTail’s Jobs. |
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))
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
metricId | string | yes | From 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))
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
metricId | string | yes | From tktail_list_metrics. | |
from | string | Interval start: “2026-10-09T10:00:00” (local wall clock) or with Z / an offset. | ||
to | string | Interval end (default now); only with from. | ||
lastSeconds | integer | 1..86400 | The last N seconds (default 300). | |
around | object | {“time”:“2026-10-09T10:00:15”,“seconds”:60}: N seconds on each side of a time (an error’s). | ||
maxSamples | integer | 1..2000 | Default 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))
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
metricIds | array | at most 16 items | From tktail_list_metrics (default: all kept, at most 16). | |
from | string | |||
to | string | |||
lastSeconds | integer | 1..86400 | ||
around | object |
tktail_sample_process
“What is this process’s CPU and memory NOW?” - instead of Get-Process, Get-Counter or typeperf (for minutes: tktail_start_metric_monitoring). Measures ONE running process for a few seconds - what Process Diagnostics shows in TKTail, without a shell or PowerShell: CPU (a share of the whole machine, as Task Manager shows it), private bytes, working set, threads, handles and I/O throughput, read by TKTail’s own Windows performance counters every second for durationMs (2000 to 8000, default 5000), then summarized per metric (min / avg / max, first / last, peak and low with their times, valid samples and samples without a value - a rate’s first reading is a warm-up, never a zero) and released. Name the process by “process” (its name, “Orders.Api” or “Orders.Api.exe”: the first process of that name - processesWithThisName says how many run) or by “pid” (pinned to that one process). An observation only: nothing is started, stopped or changed in any process. “observation” says what was measured, when and how long (complete false: cut short to answer in time). The samples stay in TKTail’s metric history (tktail_get_metric_history by metricId). Needs the Metrics capability; at most two samplings at once (a third: resource_budget_denied - ask again when one has answered). Reads counters; writes nothing.
Read-only · needs Trial or Pro (Performance counters (Metrics)) · collects Process Diagnostics of one process for 2-8 s, then releases it - nothing in the process is changed
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
process | string | at most 260 characters | The process’s name, “Orders.Api” or “Orders.Api.exe” - no path, no wildcard. | |
pid | integer | 1..4294967295 | The process id - instead of process: exactly this process. | |
durationMs | integer | 2000..8000 | How long to sample (default 5000), one reading a second. |
tktail_start_metric_monitoring
Collects ONE Metric Set for a bounded time - a service’s CPU, memory, threads and handles every 5 s for 30 minutes - without a shell, PowerShell or a script: TKTail reads the set’s Windows performance counters every intervalSeconds (5, 10 or 30; default 5) for durationMinutes (1 to 60 - required: it always ends) and keeps them in its metric history. metricSetId: builtin:process (Process Diagnostics - name the process by “process”: its name, followed across restarts, or “pid”: exactly that process), builtin:host, builtin:system-pressure, builtin:disk / builtin:network (with “instance”), or a set of the user’s or one saved with tktail_save_metric_set (tktail_list_metric_sets). TKTail runs it as an AI client’s temporary monitor of its conditional monitoring - an activation lease with a hard end, never the user’s configuration: the user sees it in Jobs (Cancel stops it) and Tools > Conditional Monitoring. Answers monitoringId, leaseId, job (number, uid - tktail_list_jobs), startedAt, expiresAt, resourceClass, the metrics (metricId: read them with tktail_get_metric_summary / tktail_get_metric_history while it runs and after) and historyRetentionMinutes (the user’s Metrics retention, default 15 - for a longer run summarize as it goes). Bounds: at most 3 at once (more: resource_budget_denied), at most 32 metrics, never a Heavy collection; needs the Metrics and Conditional Monitoring capabilities (Trial / Pro). For a few seconds of one process prefer tktail_sample_process. Starts a bounded collection; changes nothing in the user’s data or configuration.
Read-only · needs Trial or Pro (Performance counters (Metrics)) · always - the monitoring runs as an AI client’s activation lease: Trial or Pro (Conditional and scheduled monitoring) · collects one Metric Set every 5-30 s for at most 60 minutes as a temporary monitor the user sees (Jobs, Tools > Conditional Monitoring) and may stop; it ends by itself - nothing in the user’s configuration changes
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
metricSetId | string | yes | A Metric Set id: builtin:process (a process), builtin:host, set-… (tktail_list_metric_sets). | |
process | string | at most 260 characters | builtin:process: the process’s name, “ATSService” or “ATSService.exe” - followed by its name across restarts. | |
pid | integer | 1..4294967295 | builtin:process: a process id instead of process - exactly that process. | |
instance | string | at most 260 characters | An instance-bound set (builtin:disk, builtin:network): the instance (“_Total”, “0 C:”). | |
intervalSeconds | integer | 5 / 10 / 30 | How often (default 5) - never faster than every 5 s. | |
durationMinutes | integer | yes | 1..60 | How long - it stops by itself then. |
description | string | at most 200 characters | What it is for - shown with its job in TKTail’s Jobs. |
tktail_stop_metric_monitoring
Stops a metric monitoring an AI client started (tktail_start_metric_monitoring’s monitoringId) before its end - the same as Stop in TKTail’s Tools > Conditional Monitoring or Cancel in Jobs. Its samples stay in the metric history for the retention. A monitoring that already ended says so; a user’s monitor is never stopped here.
Read-only · needs Trial or Pro (Performance counters (Metrics)) · ends the AI client’s own metric monitoring before its time - its samples stay in the metric history; a user’s monitor is never stopped
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
monitoringId | string | yes | From tktail_start_metric_monitoring. |
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 what the user opened and, for a bounded time, what an AI client asks for: tktail_sample_process (one process, seconds) and tktail_start_metric_monitoring (one set, up to an hour). 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 for people: “%”, “bytes”, “bytes/s”, “/s”, “s”, “count”; unitKey / unitKind the canonical word: count, percent, bytes, bytesPerSecond, perSecond, seconds), “definition” - the metric exactly as tktail_save_metric_set and an alert’s metric source take it - and whether TKTail collects it now. Read-only.
Read-only · needs Trial or Pro (Performance counters (Metrics))
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
id | string | yes | A 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; provider (pdh) and unit (count / percent / bytes / bytesPerSecond / perSecond / seconds) may be left out: TKTail infers the unit from the counter; a “definition” from tktail_list_metrics / tktail_get_metric_set can be copied as it is), 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, and saving one starts no collection; alerts and Metrics Views use it.
Changes data - needs “Allow AI to save searches and Metric Sets” · needs Trial or Pro (Performance counters (Metrics))
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
name | string | yes | at most 64 characters | |
description | string | |||
metrics | array | yes | at most 64 items | |
metricSetId | string | |||
expectedContent | string | Changing a set: its contentId as you read it. |
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”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
metricSetId | string | yes | ||
expectedContent | string | yes |
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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
kind | string | builtin / 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
formatId | string | yes | “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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
sourceId | string | |||
sample | object | |||
definition | object | Optional: 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
definition | object | A draft format profile (JSON). | ||
formatId | string | An installed format: builtin:<key> or custom:<id>. | ||
sourceId | string | |||
from | string | start / end | ||
line | integer | 1.. | ||
sample | object | |||
maxRecords | integer | 1..50 | ||
maxFields | integer | 1..64 | ||
maxFieldBytes | integer | 64..2048 | ||
explain | boolean | List 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
template | string | lineBased / multiline / cloneAppLog / delimited | ||
id | string | |||
name | string | at most 100 characters | ||
sourceId | string | An 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
definition | object | yes | The 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”
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
definition | object | yes | The format profile JSON (validated again before writing). | |
replacesVersion | integer | 1.. | Replacing an installed profile: its current profileVersion. | |
applyToSourceId | string | An open log file to use the saved profile for (View As, this session). | ||
favorite | boolean | Mark it as a favorite format - only when the user asked. |
Extended Investigation
tktail_list_investigation_roots
Extended Investigation: what the user allows AI clients to read from disk beyond what is open in TKTail - the Allow rules of the user’s AI access rules (default deny; only the user adds, excludes or removes, in TKTail: the File Explorer’s AI Access menu, Tools > AI Access Rules…). Each with its rootId, path, kind (folder, file, filter + masks), recursive, label, enabled and whether it is usable now; someFilesExcluded when an exclusion narrows them (its path is never told); rulesBlocked when TKTail cannot read a rule (then none is used). extendedInvestigation.available is false only while TKTail runs in safe mode (every edition has it) - then only the Safe Workspace (what is open) is searched. Inside the rules: tktail_discover_files, tktail_search with {“kind”:“folder”,“path”:…}, tktail_open_source; a path outside them is outside_investigation_access. Read-only.
Read-only
No arguments.
tktail_discover_files
Lists the files an AI access rule allows (rootId; or a folder inside 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
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
rootId | string | yes | From tktail_list_investigation_roots. | |
folder | string | An absolute folder below that root (default: the root). | ||
include | string | |||
exclude | string | |||
recursive | boolean | |||
maxFiles | integer | 1..1000 | ||
probe | boolean |
tktail_get_log_history
Extended Investigation: the generations of one log in its folder, decided by names only (nothing opened or decompressed) - numbered rotation (app.log, app.log.1, app.log.2.gz, a higher number older); a dated File Series by date, date and time, date and sequence or date, time and sequence, the token anywhere in the name (u_ex261107.log.gz, app_2026-11-08.log, app_20261109_2315.log, log2026110923.txt, app_2026-11-09T23-15-00.log, app_20261109_1.log, 20261109_app.log, app.log.2026-11-09.23-15; the first file of a period may carry no number - log20261109.txt before log20261109_001.txt); or a fixed current name with renamed history (app.log written now, app-2026-11-08_23-00.log or app.log.2026-11-08 rotated - fixedCurrentName). Ask TKTail; never order generations by their names yourself: each generation has its rotationKey (kind date / datetime / date+sequence / datetime+sequence / sequence / current, date, time, sequence), order (0: newest) and current; currentGeneration names the file written now. A gzip / zstd / xz / bzip2 / lz4 generation is the same generation as its plain name, and one generation stored twice (app.log.1 and app.log.1.gz) counts once (copiesSkipped; the plain file first, then gzip, zstd, xz, bzip2, lz4). path: the log (any generation) the AI access rules allow, or a sourceId (every generation is decided by the rules too). Each generation with its path and storage (plainFile, gzipStream, zstdStream, xzStream, bzip2Stream, lz4Stream), newest first; searchScope {“kind”:“history”} searches them all in one search, oldest first - the same generations. A sourceId uses the open tab’s series pattern (the generations its rotation menu lists; patternFrom says which reading was used). Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
path | string | yes | A log file the AI access rules allow, or a sourceId. | |
series | string | Optional: the File Series pattern to read the names with, as a history search’s “series” (app_{YYYY-MM-DD}_{N}.log, u_ex{YYMMDD}.log); only when TKTail’s own reading is not the one wanted. |
tktail_list_archive_entries
Extended Investigation: the entries of a ZIP (ZIP64), 7Z, TAR, TAR.GZ / TGZ, TAR.ZST, TAR.XZ, TAR.BZ2, TAR.LZ4 or RAR / RAR5 the AI access rules allow - entry path, index, size, modified time (UTC), whether it is a regular file and whether it is encrypted - from the archive’s directory (ZIP, 7Z) or headers (TAR, RAR): nothing is extracted. A compressed TAR is walked from its start (longer for a large one; at most 10 s). include: entry masks (“.log”, “var/log/”); offset / maxEntries (1-1000, default 200) page; matching counts all that match. A GZIP / ZSTD / XZ / BZIP2 / LZ4 file holds one log (no entries). Encrypted archives are never read (no password is asked). The answer’s searchScope is the tktail_search source that reads them where they lie. Read-only.
Read-only
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
path | string | yes | An absolute archive path the AI access rules allow (tktail_discover_files). | |
include | string | Entry masks: “.log”, “var/log/” (empty: every entry). | ||
offset | integer | 0.. | ||
maxEntries | integer | 1..1000 |
Knowledge
tktail_list_knowledge
TKTail’s documentation for AI agents, built into this exact TKTail (version and commit in knowledge): how its tools, scopes, permissions, licensing, archives, rotating logs, evidence, alerts and limits work - offline and version-matched (prefer it over memory or the web). Returns topic ids, titles and sizes from a compact index - no topic text. Nothing asked: the featured topics (start here) and the categories. query: words (“archive search”, “rotation alerts”); capability: a license capability id (archive-scope); tool: a tool name (its reference and the topics about it); format: an archive format key (tar.gz); audience ai / human / both; kind concept / workflow / help / reference; all: every topic, paged with offset / maxTopics (1-100, default 20). No match means this build documents no such feature. Read-only.
Read-only · answers without a running TKTail window too
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
query | string | at most 200 characters | ||
capability | string | at most 64 characters | ||
tool | string | at most 64 characters | ||
format | string | at most 32 characters | ||
audience | string | ai / human / both | ||
kind | string | concept / workflow / help / reference | ||
all | boolean | |||
offset | integer | 0.. | ||
maxTopics | integer | 1..100 |
tktail_get_knowledge
One topic of this TKTail’s built-in documentation by id (tktail_list_knowledge): its Markdown text and metadata - audience (ai: normative MUST / MUST NOT / SHOULD / PREFER for agents; both: the user Help), the capabilities, tools and formats it is about, related topics, the build it describes. Only this topic is decompressed; its SHA-256 is checked (a damaged topic is knowledge_corrupt, never returned). maxBytes 1024-65536 (default 12288); a longer topic pages with offset / nextOffset while hasMore. tools/<name> is a tool’s reference generated from this build (arguments, permission, license capability, side effects). Read-only.
Read-only · answers without a running TKTail window too
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
id | string | yes | at most 200 characters | |
offset | integer | 0.. | ||
maxBytes | integer | 1024..65536 |
Investigation activity
tktail_get_investigation
What TKTail recorded of YOUR investigation - this client session’s calls through TKTail, as structured provenance: investigationId, title, started, origin (the transport; never another client’s), accessPolicy (the identity of the AI access policy it ran under - the AI Access Report shows the same), counts, and the newest events oldest first: seq, tool, operation, activity (one logical activity across calls: “search:24”, “hash:3”), phase, status (completed, running, incomplete, failed, denied, cancelled, timedOut), decision (allowed, aiAccessOff, mcpPermissionDenied, outsideInvestigationAccess, scopeNotAllowed, licenseCapabilityRequired, resourceBudgetDenied, dataProtectionUnavailable), summary, scope, results (bounded facts: counts, states, a SHA-256), refs (TKTail’s artifacts: a search, a job uid, a hash request, an evidence package, an alert occurrence and its evaluation trace, an activation lease - references, never their content). Use it to recall what you already did and to cite your steps. Observable tool activity only - never prompts, reasoning or model state, never raw request bodies; texts are protected by the user’s AI Data Protection rules. maxEvents 1-200 (default 50). Recording is the user’s choice (recording “off”: no record). Read-only.
Read-only · reads the caller’s own AI investigation activity (this client session’s calls as TKTail recorded them) - never another client’s; nothing is changed
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
maxEvents | integer | 1..200 | The newest events to return (default 50). |
tktail_start_investigation
Says that your next calls belong to a NEW investigation (a new question): the current investigation of this client session ends (startedNew) and a new one begins with your title, so TKTail’s AI Investigation Report keeps them apart. Optional - without it an investigation begins at your first call and ends after 30 minutes without one. Changes nothing in the user’s data or configuration. Returns investigationId (null: the user turned recording off).
Read-only · ends the caller’s current AI investigation (startedNew) and begins a new one in TKTail’s AI activity record - nothing in the user’s data or configuration changes
| Argument | Type | Required | Bounds | Description |
|---|---|---|---|---|
title | string | at most 120 characters | What the investigation is about. |