Skip to main content
Glama

control_service

Destructive

Start, stop, or restart systemd services and wait until systemd completes; optionally stop dependent services with with_dependents.

Instructions

Starts, stops or restarts a systemd service (systemd services cannot be paused) and waits until systemd has done it. Stopping one that others depend on fails and names them, unless with_dependents=true stops those too. It changes what runs now, not how the service starts (set_service_startup); get_service shows its state and dependents. Unless Anabolic runs as root, pkexec asks for an administrator's password on the desktop, and the call fails when that dialog is dismissed or cannot be shown.

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>",
      "action": "<action>"
    },
    "name": "control_service"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe service's name, as list_services gives it.
actionYesstart, stop, restart, pause or continue (pause and continue on Windows only).
with_dependentsNoFor stop and restart: also stop the running services that depend on it (otherwise stopping it is refused while any runs).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.6.1
    • changedInput schema / properties / action / description
      Previous value: -"start, stop, restart, pause or continue."New value: +"start, stop, restart, pause or continue (pause and continue on\nWindows only)."
    • changedInput schema / properties / name / description
      Previous value: -"The service's name (as in `sc query`)."New value: +"The service's name, as list_services gives it."
    • changedInput schema / properties / with_dependents / description
      Previous value: -"For stop and restart: also stop the running services that depend on\nit (otherwise Windows refuses while any runs)."New value: +"For stop and restart: also stop the running services that depend on\nit (otherwise stopping it is refused while any runs)."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond the annotations (destructiveHint=true, idempotentHint=false) by disclosing the synchronous wait, the refusal-with-names failure when dependents are running, and the pkexec password dialog plus its dismissal failure mode. What it does not state is whether the operation is reversible or what a success response contains, but the added context is substantial for an annotated mutation tool.

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?

Three front-loaded sentences, no filler: behavior and scope first, dependency semantics second, then the permission model. Every clause carries operational information an agent needs.

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 destructive 3-parameter tool with no output schema, the description covers the essential gaps: synchronous completion, dependent-service refusal, and the privilege-escalation path that can make the call fail. An agent has enough to call it correctly and to anticipate its failure modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the consequence of with_dependents (without it, stopping a depended-on service is refused and the dependents are named). It also clarifies the action semantics by noting systemd services cannot be paused, resolving a tension with the schema's 'pause or continue (Windows only)' text. It does not restate the name parameter's 'as list_services gives it' hint, which the schema already carries.

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 set and resource: 'Starts, stops or restarts a systemd service ... and waits until systemd has done it.' It also explicitly separates itself from set_service_startup ('how the service starts') and get_service ('shows its state and dependents'), so an agent can route among the three siblings without opening schemas.

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 explicit when-to-use and when-not-to-use guidance: use this for changing what runs now, use set_service_startup for startup configuration, use get_service to inspect state and dependents. It also names the condition that selects with_dependents=true and the failure that occurs without it.

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