Skip to main content
Glama
OpenSIPS

OpenSIPS MCP Server

Official
by OpenSIPS

cluster_sync_check

Assess cluster sync health by reviewing capabilities, sharing tags, and topology. Answer whether replication is healthy across all nodes in a single call.

Instructions

Report cluster sync health: capabilities, sharing tags, topology.

Combines clusterer_list, clusterer_list_cap and clusterer_list_shtags into one view so an operator can answer "is replication healthy across all nodes?" from a single call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'cluster_sync_check' tool. It's an async function decorated with @mcp.tool() and @require_permission('mi.read'). It queries four MI commands (clusterer_list, clusterer_list_cap, clusterer_list_shtags, clusterer_list_topology) and derives a health signal by checking node statuses.
    @mcp.tool()
    @require_permission("mi.read")
    async def cluster_sync_check(ctx: Context, cluster_id: int) -> dict[str, Any]:
        """Report cluster sync health: capabilities, sharing tags, topology.
    
        Combines ``clusterer_list``, ``clusterer_list_cap`` and
        ``clusterer_list_shtags`` into one view so an operator can answer
        "is replication healthy across all nodes?" from a single call.
        """
        app = ctx.request_context.lifespan_context
        out: dict[str, Any] = {"cluster_id": cluster_id}
    
        for field, cmd in (
            ("nodes", "clusterer_list"),
            ("capabilities", "clusterer_list_cap"),
            ("sharing_tags", "clusterer_list_shtags"),
            ("topology", "clusterer_list_topology"),
        ):
            try:
                out[field] = await app.mi_client.execute(cmd)
            except Exception as exc:
                out[field] = {"error": str(exc)}
    
        # Derive a simple health signal: any non-OK node status is a red flag.
        unhealthy_nodes: list[dict[str, Any]] = []
        nodes = out.get("nodes")
        if isinstance(nodes, dict):
            for v in nodes.values():
                if isinstance(v, list):
                    for n in v:
                        if isinstance(n, dict):
                            status = n.get("Status") or n.get("status")
                            if status not in (None, "OK", "Active", _STATUS_OK, "1", 1):
                                unhealthy_nodes.append(n)
        out["unhealthy_nodes"] = unhealthy_nodes
        out["healthy"] = not unhealthy_nodes
        return out
  • Registration of the cluster_sync_check tool via the @mcp.tool() decorator, which registers it as an MCP tool.
    @mcp.tool()
    @require_permission("mi.read")
  • The @require_permission('mi.read') decorator serves as an access control/permission schema entry point. The function signature defines the input schema: ctx (Context) and cluster_id (int).
    @require_permission("mi.read")
Behavior3/5

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

No annotations provided, so the description must cover behavior. It describes the tool as a report combining multiple commands, suggesting read-only intent. But it lacks details on permissions, side effects, or performance.

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?

The description is very concise, front-loaded with the purpose, and every sentence adds value. No wasted words.

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

Completeness3/5

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

Although an output schema exists, the description partially covers what the output contains (capabilities, sharing tags, topology). However, it does not describe the input parameter, and the overall completeness is adequate but not thorough.

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?

The input schema has one required parameter (cluster_id) with 0% description coverage. The tool description does not explain what cluster_id represents, relying solely on the name and context. This is a significant gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it reports cluster sync health combining capabilities, sharing tags, and topology. It includes the operator goal of checking replication health, but does not explicitly differentiate from sibling tools like cluster_status or cluster_topology.

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

Usage Guidelines3/5

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

The description implies it should be used as a single call to replace three separate clusterer_list tools, giving context for when to use it. However, it does not specify when not to use it or mention alternatives.

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