read_log
Tail large log files from the end and filter by keyword without loading the entire file. Ideal for syslog and nginx access logs.
Instructions
Safely read the end of a log file (tail), optionally filtering by a keyword (grep). Extremely efficient for huge log files as it reads backwards from the end without loading the whole file into memory. Use this instead of read_config for files like /var/log/syslog, nginx access logs, or any file that could be massive.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "read_log"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grep | No | Optional keyword to filter lines. Only lines containing this keyword (case-insensitive) will be returned. | |
| path | Yes | Absolute path to the log file (e.g. '/var/log/syslog', 'C:\logs\error.log'). | |
| lines | No | Number of lines to read from the end. Default is 100. Max is 1000. |