Skip to main content
Glama
bpamiri

CockroachDB MCP Server

by bpamiri

node_status

Retrieve node status information from a CockroachDB cluster to monitor health and performance. Specify a node ID for targeted details or get all nodes' status.

Instructions

Get detailed status for a node.

Args:
    node_id: Specific node ID (optional, returns all if not specified).

Returns:
    Node status information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
node_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes the node_status tool logic by querying CockroachDB's crdb_internal.gossip_liveness table for detailed node information.
    async def node_status(node_id: int | None = None) -> dict[str, Any]:
        """Get detailed status for a node or all nodes.
    
        Args:
            node_id: Specific node ID (optional).
    
        Returns:
            Node status information.
        """
        conn = await connection_manager.ensure_connected()
    
        try:
            query = """
                SELECT
                    node_id,
                    address,
                    build_tag,
                    started_at,
                    updated_at,
                    locality,
                    is_live,
                    ranges,
                    leases
                FROM crdb_internal.gossip_liveness
            """
    
            if node_id is not None:
                query += f" WHERE node_id = {node_id}"
    
            query += " ORDER BY node_id"
    
            async with conn.cursor() as cur:
                await cur.execute(query)
                rows = await cur.fetchall()
    
            if node_id is not None and not rows:
                return {"status": "error", "error": f"Node {node_id} not found"}
    
            nodes = []
            for row in rows:
                nodes.append(
                    {
                        "node_id": row.get("node_id"),
                        "address": row.get("address"),
                        "build_tag": row.get("build_tag"),
                        "started_at": str(row.get("started_at")) if row.get("started_at") else None,
                        "updated_at": str(row.get("updated_at")) if row.get("updated_at") else None,
                        "locality": row.get("locality"),
                        "is_live": row.get("is_live"),
                        "ranges": row.get("ranges"),
                        "leases": row.get("leases"),
                    }
                )
    
            if node_id is not None:
                return {"node": nodes[0] if nodes else None}
    
            return {"nodes": nodes, "count": len(nodes)}
        except Exception as e:
            return {"status": "error", "error": str(e)}
  • MCP tool registration with @mcp.tool() decorator. This wrapper function registers the tool and delegates to the core implementation in cluster.py.
    @mcp.tool()
    async def node_status(node_id: int | None = None) -> dict[str, Any]:
        """Get detailed status for a node.
    
        Args:
            node_id: Specific node ID (optional, returns all if not specified).
    
        Returns:
            Node status information.
        """
        try:
            return await cluster.node_status(node_id)
        except Exception as e:
            return {"status": "error", "error": str(e)}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] detailed status' but doesn't specify what 'detailed status' includes (e.g., health metrics, load, errors), whether it's read-only (implied but not explicit), or any rate limits or authentication needs. This leaves significant gaps for a tool that likely interacts with system resources.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first in a clear sentence. The Args and Returns sections are structured but slightly redundant (e.g., 'Returns:' could be inferred from 'Get'), yet overall it's efficient with minimal waste.

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?

Given the tool's moderate complexity (status retrieval with an optional parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, it lacks details on behavioral aspects like error handling or performance implications, which could be important for system monitoring tools.

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?

The description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'node_id' is optional and that omitting it 'returns all' nodes, clarifying the tool's behavior in a way the schema alone doesn't. With only one parameter well-explained, this compensates adequately for the schema's lack of descriptions.

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 the tool's purpose with a specific verb ('Get') and resource ('detailed status for a node'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'list_nodes' or 'cluster_status', which might offer related functionality, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_nodes' (which might list nodes without status details) or 'cluster_status' (which might provide broader cluster information), leaving the agent without context for tool 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/bpamiri/cockroachdb-mcp'

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