docs/tools/tools-and-system/tail-system-logs
System Configuration

Tail System Logs

CLI Tool Name: tail_system_logs

Smart context preservation log file trailing natively built around seek-from-end boundaries. Prevents catastrophic OOM LLM context window crashes against huge log files implicitly capping reads at 5MB & 1000 lines boundaries. Supports built-in keyword filtering.

Parameters

ParameterTypeRequiredDescription
file_pathstringyesThe fully-qualified path to the log file.
filter_keywordstringnoFilters lines natively returning ONLY entries matching this context string. Use for `Exception` logging safely.
max_linesnumbernoMaximum bounds returned implicitly constrained to 1000 lines default tracking.

Example output

json
{
  "line_count": 2,
  "file_size_kb": 204.5,
  "truncated": false,
  "lines": [
    "2026-04-09 20:00 [ERROR] Connection Timeout",
    "2026-04-09 20:01 [ERROR] Traceback: Exception Timeout"
  ]
}

How to use it

example prompt

Check the backend /var/log/nginx/error.log file, retrieving only the lines containing 'ERROR'. Make sure to not crash my token limit.