server_info
Return runtime identity details including build ID, active workspace root, and resolved base directory for the AIRG server instance.
Instructions
Return runtime identity details for this AIRG server instance.
Includes build id, active workspace root, and resolved base directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ctx | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/tools/command_tools.py:30-40 (handler)The server_info function is the actual handler. It returns runtime identity details: build id, active workspace root, and resolved base directory. It activates runtime context, reads SERVER_BUILD, WORKSPACE_ROOT, and BASE_DIR config values, formats them into a string, and resets the runtime context.
def server_info(ctx: Context | None = None) -> str: """Return runtime identity details for this AIRG server instance. Includes build id, active workspace root, and resolved base directory. """ tokens = activate_runtime_context(ctx) from config import BASE_DIR try: return f"ai-runtime-guard build={SERVER_BUILD} workspace={WORKSPACE_ROOT} base_dir={BASE_DIR}" finally: reset_runtime_context(tokens) - src/server.py:21-31 (registration)The server_info function is registered as an MCP tool via mcp.tool()(tool) in the FastMCP server loop. It is imported from tools and added to the list of tools registered on the 'ai-runtime-guard' MCP server.
for tool in [ server_info, restore_backup, execute_command, read_file, write_file, edit_file, delete_file, list_directory, ]: mcp.tool()(tool) - src/config.py:401-404 (helper)WORKSPACE_ROOT is a config constant that determines the active workspace root directory from environment variable AIRG_WORKSPACE or a default path (~/airg-workspace). Used by server_info handler.
SESSION_ID: str = str(uuid.uuid4()) _workspace_from_env = str(os.environ.get("AIRG_WORKSPACE", "") or "").strip() _workspace_selected = _workspace_from_env or str(_default_workspace_root()) WORKSPACE_ROOT: str = str(pathlib.Path(_workspace_selected).expanduser().resolve()) - src/config.py:407-417 (helper)SERVER_BUILD is a config constant resolved from AIRG_SERVER_BUILD env var or the installed package version. Used by server_info handler.
def _resolve_server_build() -> str: env_override = str(os.environ.get("AIRG_SERVER_BUILD", "")).strip() if env_override: return env_override try: return f"v{version('ai-runtime-guard')}" except PackageNotFoundError: return "dev" SERVER_BUILD = _resolve_server_build()