Skip to main content
Glama

Read log file

read_log_file
Read-only

Retrieve log file contents from local or remote Linux hosts for troubleshooting. Specify first or last lines to target relevant entries.

Instructions

Read a specific log file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesSystem to run on: 'localhost' for the system the MCP server runs on, or a remote host to connect to via SSH
log_pathYesAbsolute path to the log file (must be in allowed list)
last_linesNoNumber of last lines to retrieve from the log file. Default: 100. Mutually exclusive with first_lines.
first_linesNoNumber of first lines to retrieve from the log file. Mutually exclusive with last_lines.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
unitNo
entriesYes
lines_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.7.0
    • removedInput schema / properties / host / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / host / default
      Removed value: -null
    • changedInput schema / properties / host / description
      Previous value: -"Remote host to connect to via SSH"New value: +"System to run on: 'localhost' for the system the MCP server runs on, or a remote host to connect to via SSH"
    • addedInput schema / properties / host / examples
      Added value: +[
      +  "localhost",
      +  "web1.example.com"
      +]
    • addedInput schema / properties / host / type
      Added value: +"string"
    • changedInput schema / required
      Previous value: -[
      -  "log_path"
      -]New value: +[
      +  "log_path",
      +  "host"
      +]
  2. Changed6 schema fields changedv1.6.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / first_lines
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 10000,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Number of first lines to retrieve from the log file. Mutually exclusive with last_lines."
      +}
    • addedInput schema / properties / last_lines
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 10000,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Number of last lines to retrieve from the log file. Default: 100. Mutually exclusive with first_lines."
      +}
    • removedInput schema / properties / lines
      Removed value: -{
      -  "default": 100,
      -  "description": "Number of lines to retrieve from the end.",
      -  "maximum": 10000,
      -  "minimum": 1,
      -  "type": "integer"
      -}
    • changedOutput schema / properties / path / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "format": "path",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / unit / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "format": "path",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. First observedv0.1.0

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

readOnlyHint=true already tells the agent this is a safe read, so the description needn't restate safety. But it adds nothing beyond that: no mention of the allowed-list enforcement, no note that remote reads go over SSH, no disclosure of truncation/default line behavior. For a tool with a security-sensitive path constraint, this is thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single short sentence is certainly front-loaded and free of padding, but here brevity shades into under-specification rather than genuine conciseness. It is not wasteful, but it also does not earn its place by conveying anything the name and title do not already say.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the rich parameter schema covers inputs. What is missing is the surrounding context an agent needs to pick this tool correctly: the allowed-list constraint, remote-host behavior, and how it relates to the other log/file-reading siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents host, log_path, last_lines, and first_lines in detail, including their mutual exclusivity. The description adds no parameter meaning beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Read a specific log file'), so the basic operation is clear. However, it does nothing to distinguish this tool from close siblings such as read_file, get_journal_logs, or get_service_logs, which an agent must choose between. Minimum-viable clarity with a clear sibling-differentiation gap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus read_file, get_journal_logs, or get_service_logs, nor any mention of prerequisites such as the allowed-list restriction on paths or the SSH requirement for remote hosts. The agent is left to infer usage entirely from the schema and sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.