Skip to main content
Glama

List services

spm_list_services
Read-only

List every managed service and its live state to see what is running, identify exact service names, or confirm create, start, stop, and delete effects.

Instructions

List every service spm manages in the chosen scope with its live state. Call this first to see what is running, to find an exact service name, or to confirm the effect of a create, start, stop or delete; use spm_show_service for one service's full configuration. Returns structuredContent.services with one entry per unit (a multi-instance service has one entry per instance): name, status, active_state, sub_state, health, pid, cpu_percent, memory_bytes, restarts, enabled, uptime_seconds, and schedule for scheduled jobs. Values the platform cannot report are null. An empty array means no services exist in that scope. 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_list_services"
  }
}

Input Schema

NameRequiredDescriptionDefault
systemNoManage machine-wide services instead of the current user's. Requires root or Administrator; leave false unless the user asks for system scope.

Output Schema

NameRequiredDescriptionDefault
servicesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • 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."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "services": {
      +      "items": {
      +        "properties": {
      +          "active_state": {
      +            "type": "string"
      +          },
      +          "cpu_percent": {
      +            "description": "Recent CPU usage in percent.",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "enabled": {
      +            "description": "Whether it starts at login or boot, usually enabled or disabled.",
      +            "type": "string"
      +          },
      +          "health": {
      +            "description": "Health-check result, or - when none is configured.",
      +            "type": "string"
      +          },
      +          "instance": {
      +            "description": "Instance number for multi-instance services.",
      +            "type": "integer"
      +          },
      +          "memory_bytes": {
      +            "description": "Current memory usage in bytes.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "name": {
      +            "description": "Service name.",
      +            "type": "string"
      +          },
      +          "pid": {
      +            "description": "Main process ID while running.",
      +            "type": "integer"
      +          },
      +          "restarts": {
      +            "description": "Automatic restarts of the current run.",
      +            "type": "integer"
      +          },
      +          "schedule": {
      +            "description": "Schedule summary for scheduled jobs.",
      +            "type": "string"
      +          },
      +          "status": {
      +            "description": "Combined state, for example active/running or inactive/dead.",
      +            "type": "string"
      +          },
      +          "sub_state": {
      +            "type": "string"
      +          },
      +          "unit": {
      +            "description": "Native unit, job or service identifier.",
      +            "type": "string"
      +          },
      +          "uptime_seconds": {
      +            "description": "Seconds since the current process started.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "status"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "services"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.3.9

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description does not need to restate safety. It adds genuinely new behavior: system scope requires root/Administrator privileges, multi-instance services produce one entry per instance, unreportable values are null, and an empty array is a meaningful result rather than an error. The enumeration of return fields overlaps with the existing output schema, which is the only redundancy.

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 the 'call this first' directive, then scope and privilege caveats, so the important content is early. Some length is spent listing every returned field that the output schema already documents, which is the main place wording could be trimmed.

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 single-parameter read-only listing tool with full schema coverage and an output schema, the description covers scope semantics, privilege requirements, per-instance cardinality, null handling, and the empty-result case. Nothing an agent needs in order to call or interpret it is missing.

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?

There is a single parameter with 100% schema description coverage that already covers the default and the root/Administrator requirement. The description reinforces the same meaning ('acts on the current user's services unless system is true') but contributes no format or edge-case detail beyond the schema, so the baseline 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 ('List every service spm manages in the chosen scope with its live state') and draws an explicit boundary against the sibling spm_show_service. An agent can select between the list and detail views without opening either 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 when-to-use cases ('call this first to see what is running, to find an exact service name, or to confirm the effect of a create, start, stop or delete'), names the alternative for single-service detail, and states an explicit when-not-to-use rule for system scope ('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.