Skip to main content
Glama

get_journal_logs

Read systemd journal entries with filters for unit, priority, and time range (since/until). Query user journals or recent lines to diagnose service and system issues.

Instructions

Reads systemd journal entries with optional filtering by unit, priority, and time range (since/until). Set user=true for the user journal. Read-only via journalctl. Fatal only if journalctl fails or an invalid unit is given. Returns structured entries with timestamp, message, priority, unit, and PID. For auditd AVC/syscall events use get_audit_logs.

Input Schema

NameRequiredDescriptionDefault
unitNooptional systemd unit name (e.g. 'nginx.service')
userNoquery user-level journal (default: false)
linesNonumber of recent lines (default: 50)
sinceNooptional start time (e.g. '1 hour ago', '2024-07-03')
untilNooptional end time
priorityNooptional log priority: emerg,alert,crit,err,warning,notice,info,debug

Output Schema

NameRequiredDescriptionDefault
errorsNo
entriesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares read-only access ('Read-only via journalctl') and defines the failure surface ('Fatal only if journalctl fails or an invalid unit is given'). It does not state permission requirements (journal access often needs root or the systemd-journal group), which is the notable remaining gap for a log-reading tool.

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 purpose and filters, then behavior, then the sibling redirect. The return-field enumeration (timestamp, message, priority, unit, PID) is slightly redundant given an output schema exists, but otherwise every sentence earns its place with no padding.

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?

An output schema exists, so not explaining return values in depth is fine, and the description still covers filtering, the user-journal mode, error behavior, and sibling routing. The one real omission is authentication/permission context for reading the journal, which agents would otherwise have to infer.

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 all six parameters including defaults and time syntax examples are already documented in the schema. The description restates unit, priority, time range, and the user flag without adding format or constraint detail beyond that. Baseline 3 applies.

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 systemd journal entries') plus the exact filter dimensions (unit, priority, since/until). It also explicitly names the sibling it is not for — 'For auditd AVC/syscall events use get_audit_logs' — so an agent can separate it from get_audit_logs and get_docker_container_logs without opening any schema.

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?

Gives clear context: 'Set user=true for the user journal' and routes auditd AVC/syscall traffic to get_audit_logs. It lacks broader when-not guidance (e.g. when to prefer get_systemd_units or get_service_status for unit health), but the primary alternative is named with its selecting condition.

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