Skip to main content
Glama

Get service logs

get_service_logs
Read-only

Fetch recent log lines for a specified systemd service on a local or remote host to diagnose issues.

Instructions

Get recent logs for a specific systemd service.

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
linesNoNumber of log lines to retrieve.
service_nameYesName of the systemd service

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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: -[
      -  "service_name"
      -]New value: +[
      +  "service_name",
      +  "host"
      +]
  2. Changed1 schema field changedv1.6.0
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observedv0.1.0

TDQS

B3.1/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 bar is lower. The description only adds the word 'recent'; it says nothing about whether it reads via journald, whether elevated privileges or SSH keys are needed on remote hosts, or any truncation/rate behavior, so it adds almost no context beyond the annotation.

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?

A single front-loaded sentence with no filler. Nothing is redundant and the key resource qualifier ('systemd service') comes immediately.

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?

With an output schema present and 100% param coverage, return values and parameters need no description space. However, for a log-retrieval tool sitting next to get_journal_logs and read_log_file, the total absence of routing guidance leaves a meaningful completeness gap.

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 host, service_name, and lines are fully documented in the schema (including SSH semantics and line limits). 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.

Purpose4/5

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

States a specific verb and resource: getting recent logs for a specific systemd service. Clear enough to distinguish from generic file readers, but it never names or rules out overlapping siblings such as get_journal_logs, which can also return per-unit service output.

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 when-to-use guidance, no exclusions, and no mention of alternatives. An agent facing get_journal_logs, read_log_file, and this tool gets no signal about which to pick for service log output.

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