Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

registrar_stats

Fetch registration counts, expiry statistics, and related counters from OpenSIPS registrar and usrloc modules to monitor registrar performance and user activity.

Instructions

Retrieve registrar-related statistics.

Returns registration counts, expiry stats, and related counters from the OpenSIPS registrar and usrloc modules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'registrar_stats' tool. It uses the MCP tool decorator, RBAC permission 'mi.read', and executes a 'get_statistics' MI command for 'registrar:' and 'usrloc:' statistics.
    @mcp.tool()
    @require_permission("mi.read")
    async def registrar_stats(ctx: Context) -> dict[str, Any]:
        """Retrieve registrar-related statistics.
    
        Returns registration counts, expiry stats, and related counters
        from the OpenSIPS registrar and usrloc modules.
        """
        app = ctx.request_context.lifespan_context
        result = await app.mi_client.execute(
            "get_statistics",
            {"statistics": ["registrar:", "usrloc:"]},
        )
        return result
  • The import that registers the registrar_tools module (containing the registrar_stats tool) with the MCP server.
    from opensips_mcp.tools import registrar_tools as _registrar_tools  # noqa: E402, F401
  • The RBAC permission decorator 'mi.read' applied to the registrar_stats tool, enforcing access control.
    @mcp.tool()
    @require_permission("mi.read")
    async def registrar_stats(ctx: Context) -> dict[str, Any]:
        """Retrieve registrar-related statistics.
    
        Returns registration counts, expiry stats, and related counters
        from the OpenSIPS registrar and usrloc modules.
        """
        app = ctx.request_context.lifespan_context
        result = await app.mi_client.execute(
            "get_statistics",
            {"statistics": ["registrar:", "usrloc:"]},
        )
        return result
Behavior3/5

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

No annotations provided. Description implies a read-only operation ('Retrieve'), but does not explicitly state safety, permissions, or data freshness. Adequate but not extra.

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 front-loading the purpose, with specific details in the second. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With zero parameters and an output schema, the description sufficiently outlines what statistics are returned. Could mention it returns live data, but overall complete.

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?

No parameters (baseline 4). Description adds no param info, but none needed due to empty schema. Schema coverage is 100%.

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 specifies 'Retrieve registrar-related statistics' and details 'registration counts, expiry stats, and related counters' from specific modules, clearly distinguishing it from other stats tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus other stats tools (e.g., sl_stats, nathelper_stats) or alternative methods (e.g., ul_dump). Missing context for selection.

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/OpenSIPS/opensips-mcp-server'

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