Skip to main content
Glama

Restart service

spm_restart_service

Stop and start a managed service to load new code, configuration, or environment variables. The service briefly gets a new PID; multi-instance services restart one instance at a time.

Instructions

Stop and start a managed service so it picks up new code, configuration or environment. The process gets a new PID and is briefly unavailable; a multi-instance service is restarted one instance at a time so the others keep serving. A stopped service is simply started. 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

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
nameYesManaged service name.
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. Changed1 schema field 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."
  2. First observedv0.3.9

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond annotations, which only say it is not read-only and not open-world. The description discloses the new PID, the brief unavailability window, one-instance-at-a-time rolling restart for multi-instance services, default user-scope targeting, and privilege requirements for system scope. This is exactly the operational context an agent needs before causing downtime.

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?

Three tight sentences, front-loaded with the purpose and the availability impact. Slightly repetitive on the system-scope privilege rule, which the schema already states, but no sentence is wasted.

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?

For a two-parameter mutation with no output schema, the description covers side effects, downtime, scope, and privilege needs. It does not say what the tool reports back after restart (e.g., whether the new PID is returned), a minor omission.

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% and the schema already documents both the name and system parameters, including the root/Administrator requirement and the 'leave false unless asked' rule. The description largely restates the system-scope privilege requirement rather than adding new parameter meaning, 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?

States a specific compound action (stop then start) on a named resource (managed service) and gives the reason (pick up new code, config, environment). This distinguishes it from the sibling start/stop/enable/disable tools without needing their schemas.

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 for when this applies (code/config changes) and an explicit edge-case rule: 'A stopped service is simply started.' Constrains the system param to user-requested scope. It stops short of explicitly naming spm_start_service/spm_stop_service as alternatives for single-step cases.

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