server_info
Retrieve runtime identity details for an AI runtime guard server instance, including build ID, workspace root, and base directory.
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 actual server_info tool handler function. It activates runtime context, then returns a string with the build ID, workspace root, and base directory.
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/tools/command_tools.py:30-40 (schema)The server_info function takes an optional Context and returns a str. No complex schema — it's a simple string output.
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)Registration: the server_info function is passed to mcp.tool()() on line 22, registering it as an MCP tool.
for tool in [ server_info, restore_backup, execute_command, read_file, write_file, edit_file, delete_file, list_directory, ]: mcp.tool()(tool) - src/tools/__init__.py:1-14 (registration)Export of server_info from the tools package, making it importable by server.py.
from .command_tools import execute_command, server_info from .file_tools import delete_file, edit_file, list_directory, read_file, write_file from .restore_tools import restore_backup __all__ = [ "server_info", "execute_command", "read_file", "write_file", "edit_file", "delete_file", "list_directory", "restore_backup", ] - src/config.py:407-417 (helper)The _resolve_server_build() helper used by server_info to determine the build version string.
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()