Skip to main content
Glama

services/list

Read-onlyIdempotent

List loaded systemd service units with load, active, and sub states. Filter by exact state or name pattern, and use JSON output for structured results.

Instructions

Lists systemd .service units that systemd currently has loaded, with load, active and sub state (D-Bus ListUnits). Read-only. An installed but never-loaded unit file may be missing, and timers, sockets and other unit types are not included. pattern supports only a leading and/or trailing * (kube*, *ssh*); without * it is an exact unit name including .service. The state filters are exact strings: active_state active/failed/inactive, sub_state running/exited/dead, load_state loaded/not-found. Text output is a block per unit plus a hint line, or No services found matching the criteria.; output_format: json returns an array of objects (name, description, load_state, active_state, sub_state), [] when empty. To change a service use services/manage, for one unit's details the service://<name>/status resource, for its logs logs/journal-control.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternNoOnly a leading and/or trailing * is supported ('kube*', '*ssh*'); without * an exact unit name including '.service'
sub_stateNoExact state: 'running', 'exited' or 'dead'
load_stateNoExact state: 'loaded' or 'not-found'
privilegedNoRun as root (may be required depending on policies)
active_stateNoExact state: 'active', 'failed' or 'inactive'
output_formatNoUse json for structured output (yaml, table and wide return the same JSON); default is text

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.4.1
    • changedInput schema / properties / active_state / description
      Previous value: -"Filter by active state (e.g., 'active', 'failed', 'inactive')"New value: +"Exact state: 'active', 'failed' or 'inactive'"
    • changedInput schema / properties / load_state / description
      Previous value: -"Filter by load state (e.g., 'loaded', 'not-found')"New value: +"Exact state: 'loaded' or 'not-found'"
    • changedInput schema / properties / output_format / description
      Previous value: -"Desired output format (e.g. json, table, wide). Defaults to text"New value: +"Use json for structured output (yaml, table and wide return the same JSON); default is text"
    • changedInput schema / properties / pattern / description
      Previous value: -"Wildcard pattern to match service names (e.g., 'kube*', '*ssh*')"New value: +"Only a leading and/or trailing * is supported ('kube*', '*ssh*'); without * an exact unit name including '.service'"
    • changedInput schema / properties / sub_state / description
      Previous value: -"Filter by sub state (e.g., 'running', 'exited', 'dead')"New value: +"Exact state: 'running', 'exited' or 'dead'"
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld=false, so the 'Read-only' restatement is redundant. However the description adds real behavioral context: installed-but-never-loaded units may be missing, other unit types are excluded, and empty results return a specific message or `[]`. That goes meaningfully beyond the annotations.

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?

Purpose is front-loaded in the first sentence, followed by caveats and routing hints in a compact block. It is dense and largely earn-its-place, though slightly long with some duplication of the schema's pattern/state wording.

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?

With no output schema, the description fully documents return behavior: per-unit text blocks plus a hint line, the exact empty-result string, and the JSON array shape with its field list. Combined with the filtering caveats, an agent has everything needed to call and interpret it.

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 the schema already documents all six parameters, including the pattern syntax and exact state values. The description restates the same pattern and state facts but adds no new syntax or defaults beyond the schema, so 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?

Opens with a specific verb and resource: 'Lists systemd .service units that systemd currently has loaded', then bounds the scope by naming what is excluded (timers, sockets, other unit types, never-loaded installed files). This lets an agent distinguish it from services/manage and timers/list 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?

Explicitly routes the agent elsewhere: 'To change a service use services/manage', the status resource for a single unit, and logs/journal-control for logs. It also gives the filtering context (loaded vs installed units). Nothing is left to inference.

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