Skip to main content
Glama

os_restart_api

Safely restart the AI Team OS FastAPI process after backend code changes, with guards for busy agents and port consistency.

Instructions

Restart the AI Team OS FastAPI process safely (standardized restart flow).

Use this after backend code changes to pick up the new version without manually killing processes. The flow has three safety guards:

  1. Busy-agent guard — refuses to restart while any agent is working (status=busy) unless force=True.

  2. Port-pin guard — only ever restarts on the ORIGINAL port (default 8000, read from api_port.txt). If that port is held by an unrelated process it aborts rather than drifting to a random port.

  3. Dead-before-spawn guard — waits until the old process has fully exited and released the port before spawning the new one; never spawns on a timeout.

If the API is already down there is nothing to shut down: guards 1 and 3 do not apply, guard 2 still does, and this becomes a plain start of the API on its configured port.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoBypass the busy-agent guard and restart even while agents work.
dry_runNoOnly preflight imports and return the startup plan, without shutting down, spawning, or updating shared runtime files.
source_rootNoExplicit ai-team-os repository root to import and start. Empty preserves the current environment. Restore by explicitly passing the original repository root through this same flow.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.12.3
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "default": false,
      +  "description": "Only preflight imports and return the startup plan, without\nshutting down, spawning, or updating shared runtime files.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / source_root
      Added value: +{
      +  "default": "",
      +  "description": "Explicit ai-team-os repository root to import and start.\nEmpty preserves the current environment. Restore by explicitly\npassing the original repository root through this same flow.",
      +  "type": "string"
      +}
  2. First observedv1.9.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly. It discloses the three safety guards, busy-agent refusal unless force=True, original-port pinning, dead-before-spawn sequencing, and the special behavior when the API is already down.

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?

The description is front-loaded with purpose and usage, then uses a numbered list to organize the safety guards. It is somewhat long, but the length is justified by the lack of annotations and the complexity of the restart behavior.

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 complex operational tool with no annotations, the description is complete enough for correct invocation. It explains the restart flow, safety constraints, force behavior, and the API-down edge case, while the output schema can describe return values.

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 description coverage is 100%, so the schema already documents force, dry_run, and source_root fully. The description adds useful context for force via the busy-agent guard, but dry_run and source_root are not elaborated beyond their schema descriptions, so the baseline 3 is appropriate.

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?

The description states a specific verb and resource: restart the AI Team OS FastAPI process safely. It clearly distinguishes this operational restart tool from siblings like os_health_check and os_config_change by describing the exact process restarted and the standardized flow used.

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?

It gives a clear when-to-use trigger: after backend code changes to pick up the new version without manually killing processes. It also covers the edge case where the API is already down, but it does not explicitly name alternative tools or state when not to use this tool.

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

Deploy Server

Other Tools