Skip to main content
Glama
PainInTheNic

ubuntu-mcp-server

by PainInTheNic

Tail Logs

ubuntu_tail_log
Read-onlyIdempotent

Troubleshoot Ubuntu server issues by reading recent journal or file logs, optionally filtered by unit, time, or keyword.

Instructions

Read recent log lines from an Ubuntu server — either from the systemd journal (journalctl) or from a log file — optionally filtered to lines containing a search string.

Args:

  • server (string): server name from the inventory (see ubuntu_list_servers)

  • source ('journal' | 'file'): where to read from (default 'journal')

  • unit (string, journal only): systemd unit, e.g. 'nginx' — omit for the whole journal

  • path (string, file only, required): absolute file path, e.g. '/var/log/syslog'

  • lines (number): how many recent lines, 1-1000 (default 100)

  • since (string, journal only): time filter like '1 hour ago' or 'today'

  • grep (string): only lines containing this text (case-insensitive fixed string)

  • use_sudo (boolean): read as root for protected logs (default false)

Returns: the matching log lines as plain text.

Error handling: permission errors suggest use_sudo=true or adding the user to the 'adm'/'systemd-journal' groups.

Examples:

  • "errors in nginx logs in the last hour" -> source='journal', unit='nginx', since='1 hour ago', grep='error'

  • "last 50 lines of /var/log/auth.log" -> source='file', path='/var/log/auth.log', lines=50

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
grepNoOnly return lines containing this text (fixed string, case-insensitive)
pathNofile only: absolute path of the log file, e.g. '/var/log/nginx/error.log'
unitNojournal only: limit to one systemd unit, e.g. 'nginx' (omit for the full journal)
linesNoNumber of lines to return
sinceNojournal only: e.g. '1 hour ago', 'today', '2026-08-08 10:00'
serverYesServer name from the inventory (see ubuntu_list_servers)
sourceNo'journal' reads systemd's journal (journalctl); 'file' tails a log filejournal
use_sudoNoRead via sudo -n, for logs your user cannot read (requires passwordless sudo)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYes
sourceYes
filteredYes
truncatedNo
line_countYes
Behavior4/5

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

Annotations already declare the tool read-only and idempotent. The description adds valuable behavioral context beyond that: permission errors suggest use_sudo=true or group membership, and it explicitly states that the tool returns plain text. This goes beyond simple safety signaling and covers real edge cases.

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

Conciseness5/5

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

The description is well-structured with clear sections: summary, Args, Returns, Error handling, and Examples. Every section earns its place; there is no filler. It front-loads the core purpose and avoids redundancy with the schema.

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

Completeness5/5

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

For a tool with 8 parameters, two source modes, and conditional requirements, this description is highly complete. It covers both modes, defaults, error handling, sudo usage, and return format, and includes worked examples. No critical use-case information is missing.

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 description coverage is 100%, so the baseline is 3. The description adds value by grouping parameters by source mode ('journal only', 'file only'), showing defaults, and providing concrete examples that combine multiple parameters (e.g., source='journal', unit='nginx', since='1 hour ago', grep='error'). This is more helpful than the raw schema.

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?

The description opens with a specific verb and resource: 'Read recent log lines from an Ubuntu server' and clearly distinguishes the two source modes (journal vs file). It is immediately distinct from sibling tools like ubuntu_service_status and ubuntu_run_command.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (need recent log lines) and gives detailed examples (e.g., 'errors in nginx logs in the last hour') that map natural language to parameter combinations. However, it does not explicitly mention when NOT to use it or contrast it with alternatives like ubuntu_service_status, so top marks are withheld.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PainInTheNic/MCP-Ubuntu'

If you have feedback or need assistance with the MCP directory API, please join our Discord server