Skip to main content
Glama

Read Host File

file_read
Read-onlyIdempotent

Read the last lines of any absolute file on an Unraid host over SSH, with optional server-side regex filtering for large logs or files the GraphQL API cannot access.

Instructions

Read-only. Returns the last lines lines of any absolute file path on the Unraid host over SSH, reaching files the GraphQL API cannot (e.g. /boot/logs/syslog-previous, /proc/cpuinfo). Optional pattern (extended regex) filters server-side via grep before the tail, so searching huge logs stays cheap. Prefer log_read for any log that log_list returns: it needs no SSH and pages from any line. file_read only tails, and output beyond 30000 characters is truncated. Requires SSH to be configured (UNRAID_SSH_* environment variables); reads run as the SSH user (typically root).

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": "file_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the file on the Unraid host (must start with `/`).
linesNoLines to return from the end of the file, or the last N matching lines when `pattern` is set.
patternNoExtended regex (grep -E); only matching lines are returned, filtered on the host before the tail.
response_formatNo`detailed` returns full JSON instead of readable text.concise

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / lines / description
      Added value: +"Lines to return from the end of the file, or the last N matching lines when `pattern` is set."
    • addedInput schema / properties / path / description
      Added value: +"Absolute path of the file on the Unraid host (must start with `/`)."
    • addedInput schema / properties / pattern / description
      Added value: +"Extended regex (grep -E); only matching lines are returned, filtered on the host before the tail."
    • addedInput schema / properties / response_format / description
      Added value: +"`detailed` returns full JSON instead of readable text."
  2. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantive behavior the annotations don't: SSH dependency, execution as the SSH user (typically root), tail-only semantics, and 30000-character output truncation. 'Read-only' at the start is redundant with readOnlyHint=true, which keeps this from a full 5.

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

Conciseness4/5

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

Front-loaded with the core action and scope, then examples, then routing guidance, then constraints — a sensible order with no padding. Minor waste: 'Read-only.' duplicates the annotations, and 'file_read only tails' restates the opening sentence's tail semantics.

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

Completeness4/5

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

With no output schema, the description covers return behavior (readable text vs detailed JSON), truncation limits, and the prerequisite failure mode (SSH not configured), which is enough for an agent to call it correctly. It does not describe what happens when the path does not exist or permissions are denied, leaving error handling partly implicit.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns a small bump by explaining that pattern filtering happens server-side via grep before the tail 'so searching huge logs stays cheap,' which is a cost/behavioral rationale the schema does not state. It otherwise restates the path/lines/pattern semantics already documented in the schema, so it is not a strong 5.

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

Purpose5/5

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

States a specific verb and resource (reads the last N lines of an absolute host file over SSH) plus concrete scope examples (/boot/logs/syslog-previous, /proc/cpuinfo). It explicitly differentiates itself from the sibling log_read and from the GraphQL API path, so an agent can pick it without opening the schema.

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

Usage Guidelines5/5

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

Gives an explicit routing rule: 'Prefer log_read for any log that log_list returns: it needs no SSH and pages from any line,' and reserves this tool for files the GraphQL API cannot reach. It also names the precondition (SSH configured via UNRAID_SSH_* variables), so the when-to-use and when-not-to-use cases are both covered.

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