Skip to main content
Glama

os_restart_api

Restart the API process safely after code changes, using guards to prevent disruption from busy agents or port conflicts.

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, steps 2-4 are skipped 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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses behavior: three safety guards (busy-agent, port-pin, dead-before-spawn) and fallback to plain start if API is down. Auth and rate limits are not mentioned, but the restart flow is transparent.

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 well-structured with bullet points and clear sections. It is front-loaded with purpose and then details guards. Slightly verbose but every sentence adds value; minor conciseness improvements possible.

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?

Given the tool's complexity (restart with safety guards) and that an output schema exists, the description provides complete context: what it does, when to use, three guards, handling of down API. No gaps for agent invocation.

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?

The schema covers the 'force' parameter with a description, but the tool description adds context about the busy-agent guard and when to use force, enhancing semantics beyond the schema alone.

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 clearly states the tool restarts the AI Team OS FastAPI process safely, distinguishing it from siblings like os_health_check (health monitoring) and os_report_issue (issue reporting). The verb 'restart' and resource 'AI Team OS FastAPI process' are specific.

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?

The description explains when to use: 'after backend code changes to pick up the new version'. It provides context but does not explicitly state when not to use or mention alternatives. The safety guards imply conditions for use, but missing explicit exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CronusL-1141/AI-company'

If you have feedback or need assistance with the MCP directory API, please join our Discord server