You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
backupList and JSON API tools return unbounded raw output to the model #117
homelab_backupList returns restic snapshots --json for the whole repository with no limit, and several API tools return raw service JSON unchanged. The only bound is the 1 MiB output cap, and when it trips the JSON is cut from the front and no longer parses.
Where
mcp-server/src/tools/backupList.ts:30 (no count/--latest, unlike backupStatus)
A daily backup schedule produces about 365 snapshots a year. At roughly 500-800 bytes of JSON each, one backupList call returns 200-300 KB, which is tens of thousands of tokens and more than common MCP clients accept for a single tool result. Broad PromQL queries behave the same way. The model gets truncated, unparseable JSON or uses up its context.
Steps to reproduce
Repository with a year of daily snapshots.
Call homelab_backupList with no filters.
Suggested fix
Add count (default 20, max 200) to backupList.
For JSON tools, parse and return a compact summary by default (backupList: id, time, host, paths, tags; prometheusQuery: labels and value, first N series with a "N more" note), with an option for raw output.
Truncate at entry boundaries rather than with the byte tail.
Acceptance criteria
backupList output size is bounded by a parameter.
JSON tools never return syntactically broken JSON because of truncation.
Fixed in b7017a0. backupList now takes count (default 20, max 200) and returns compact newest-first entries; prometheusQuery takes limit (default 100) and trims series while staying valid JSON; backupList, prometheusQuery, npmProxyHosts, npmCerts, grafanaSnapshot and adguardQueryLog return a clear error instead of cut JSON when the output cap is hit. Verified with new handler tests (369 passing).
Activity
TMHSDigital commentedon Nov 18, 2026
Fixed in b7017a0. backupList now takes
count(default 20, max 200) and returns compact newest-first entries; prometheusQuery takeslimit(default 100) and trims series while staying valid JSON; backupList, prometheusQuery, npmProxyHosts, npmCerts, grafanaSnapshot and adguardQueryLog return a clear error instead of cut JSON when the output cap is hit. Verified with new handler tests (369 passing).