release: r018 focused log analysis

This commit is contained in:
Mikei386 committed 2026-08-24 10:42:43 +02:00
1 parent 02deec8dc9
commit 47c27b06c4
7 files changed
+48 -13

No files matched your search

+21 -2
View File
@@ -131,7 +131,7 @@ export const TOOLS: ToolDef[] = [
{
name: "unraid_docker_analyze_logs",
description:
"Analyze container logs server-side for errors/warnings. Returns pattern counts and sample matches.",
"Analyze container logs server-side for errors/warnings in one bounded call. Use optional focus_terms to restrict results to components such as hass_mcp, yaml or zigbee instead of issuing multiple grep/shell calls. Returns pattern counts and sample matches.",
inputSchema: {
type: "object",
properties: {
@@ -144,6 +144,13 @@ export const TOOLS: ToolDef[] = [
since: str("Time filter (default 24h)"),
scan_tail: int("Max lines to scan (default 1000)"),
max_results: int("Max sample matches (default 50)"),
focus_terms: {
type: "array",
items: { type: "string", minLength: 1, maxLength: 80 },
maxItems: 12,
description:
"Optional literal component/topic terms. A log line must contain at least one term, case-insensitively. Bundle related terms in one call.",
},
},
required: ["severity"],
},
@@ -156,7 +163,19 @@ export const TOOLS: ToolDef[] = [
const since = (a["since"] as string) ?? "24h";
const scanTail = Number(a["scan_tail"] ?? 1000);
const maxResults = Number(a["max_results"] ?? 50);
return analyzeContainerLogs(severity, container ?? null, since, scanTail, maxResults);
const focusTerms = Array.isArray(a["focus_terms"])
? (a["focus_terms"] as unknown[]).filter(
(item): item is string => typeof item === "string",
)
: [];
return analyzeContainerLogs(
severity,
container ?? null,
since,
scanTail,
maxResults,
focusTerms,
);
},
},
{