Skip to main content
Glama

Get service logs

spm_get_logs
Read-only

Read recent log lines from managed services to verify clean startup, diagnose crashes or restarts, and inspect output such as URLs, ports, and errors.

Instructions

Read recent log lines from one or more managed services. Use it to check that a service started cleanly, to find why it crashed or keeps restarting, or to read its output such as URLs, ports and errors; use spm_doctor instead when spm itself or the service manager seems broken. Returns at most lines entries (default 100) as text; with several names, their entries are combined. Set health=true to read health-check output instead of service output. It never follows logs, so call it again to see newer lines. Acts on the current user's services unless system is true; machine-wide services need root on Linux and macOS or an Administrator shell on Windows, so only use system when the user asks for it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "spm_get_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
grepNoOnly return lines matching this pattern, for example error.
linesNoMaximum number of log lines to return.
namesNoService names to read. Omit to read logs for all managed services in the scope.
sinceNoOnly return entries newer than this: a relative time such as 10m or 1h, or a date such as 2026-01-01.
healthNoRead health-check logs instead of the service's own output.
systemNoManage machine-wide services instead of the current user's. Requires root or Administrator; leave false unless the user asks for system scope.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / grep / description
      Previous value: -"Optional journal grep expression."New value: +"Only return lines matching this pattern, for example error."
    • addedInput schema / properties / health / description
      Added value: +"Read health-check logs instead of the service's own output."
    • addedInput schema / properties / lines / description
      Added value: +"Maximum number of log lines to return."
    • changedInput schema / properties / names / description
      Previous value: -"Service names. Omit to read logs for all managed services."New value: +"Service names to read. Omit to read logs for all managed services in the scope."
    • changedInput schema / properties / since / description
      Previous value: -"Optional journal time expression such as 1h or 2026-01-01."New value: +"Only return entries newer than this: a relative time such as 10m or 1h, or a date such as 2026-01-01."
    • changedInput schema / properties / system / description
      Previous value: -"Manage machine-wide services instead of current-user services."New value: +"Manage machine-wide services instead of the current user's. Requires root or Administrator; leave false unless the user asks for system scope."
  2. First observedv0.3.9

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), so the description rightly focuses on operational traits: no log following, bounded return size, merged output across names, and root/Administrator requirements for system scope. Those additions are genuinely useful, but the return payload is described only loosely as 'text' with no structure, ordering, or error behavior, so it does not go far beyond the annotations-plus-schema baseline.

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 the primary decision points, and most sentences carry distinct information. The system-scope caution is stated once in the body and again in the schema, and the paragraph is dense enough that the tail-end privilege details are easy to skim past.

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 does the necessary work of explaining the return shape (bounded text entries, merged across names) and the non-streaming nature that requires repeat calls. What remains thin is error handling and whether grep/since interact with the line cap, minor gaps for a six-parameter read tool.

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 coverage is 100%, so every parameter is already documented, which sets the baseline at 3. The description clarifies cross-parameter behavior — that multiple names combine into one result, that health=true swaps the log source, and that system scope needs elevated privileges — but adds no syntax or format detail beyond what the schema states.

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?

Opens with a specific verb and resource ('Read recent log lines from one or more managed services'), and immediately positions itself against a named sibling (spm_doctor) for the broken-manager case. An agent can tell this apart from spm_show_service or spm_doctor 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 Guidelines5/5

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

Gives concrete triggering scenarios: verifying clean startup, diagnosing a crash or restart loop, and reading output like URLs, ports and errors. It names the alternative (spm_doctor) and the condition that selects it, and adds a scope caution ('only use system when the user asks for it').

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