Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
  • 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())
  • 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()
Behavior4/5

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

No annotations are provided, so description carries full burden. It discloses a read-only operation with no side effects. It does not mention authentication, rate limits, or other behavioral traits, but for a simple info endpoint, this level is adequate.

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?

Two concise sentences: first sentence states purpose and scope, second details contents. No redundant words, all information is front-loaded.

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 low complexity, minimal schema, and presence of an output schema, the description adequately covers what the tool does and returns. It lists key fields, making it sufficient for an agent to understand the tool.

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

Parameters2/5

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

Schema coverage is 0% for the single parameter 'ctx', and description does not mention or explain it. The parameter is optional and default null, but without any description, the agent has no guidance. Despite the parameter likely being internal, the absence of description fails to compensate for the low schema coverage.

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?

Description clearly states the tool returns 'runtime identity details' and lists specific fields (build id, workspace root, base directory). Verb 'return' explicitly indicates the action, and the resource is well-defined. Siblings are file/command tools, so this tool is distinct.

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?

Usage is implied: when server identity info is needed. The description doesn't provide explicit when-to-use or when-not-to-use instructions, but siblings are very different, making the context clear. No alternatives are mentioned, but not critical for a simple info tool.

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/jimmyracheta/ai-runtime-guard'

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