Skip to main content
Glama

get_cluster_health_and_services

Monitor Couchbase cluster health by checking service status, connection details, and latency measurements to ensure operational reliability.

Instructions

Get cluster health status and list of all running services.

This tool provides health monitoring by:
- Getting health status of all running services with latency information (via ping)
- Listing all services running on the cluster with their endpoints
- Showing connection status and node information for each service

If bucket_name is provided, it actively pings services from the perspective of the bucket.
Otherwise, it uses cluster-level ping to get the health status of the cluster.

Returns:
- Cluster health status with service-level connection details and latency measurements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic. It connects to the cluster (and optionally a bucket), performs a ping operation to retrieve health status and services information, and returns the result in JSON format.
    def get_cluster_health_and_services(
        ctx: Context, bucket_name: str | None = None
    ) -> dict[str, Any]:
        """Get cluster health status and list of all running services.
    
        This tool provides health monitoring by:
        - Getting health status of all running services with latency information (via ping)
        - Listing all services running on the cluster with their endpoints
        - Showing connection status and node information for each service
    
        If bucket_name is provided, it actively pings services from the perspective of the bucket.
        Otherwise, it uses cluster-level ping to get the health status of the cluster.
    
        Returns:
        - Cluster health status with service-level connection details and latency measurements
        """
        try:
            cluster = get_cluster_connection(ctx)
    
            if bucket_name:
                # Ping services from the perspective of the bucket
                bucket = connect_to_bucket(cluster, bucket_name)
                result = bucket.ping().as_json()
            else:
                # Ping services from the perspective of the cluster
                result = cluster.ping().as_json()
    
            return {
                "status": "success",
                "data": json.loads(result),
            }
        except Exception as e:
            logger.error(f"Error getting cluster health: {e}")
            return {
                "status": "error",
                "error": str(e),
                "message": "Failed to get cluster health and services information",
            }
  • The registration code that adds the get_cluster_health_and_services tool (as part of ALL_TOOLS) to the FastMCP server instance.
    # Register all tools
    for tool in ALL_TOOLS:
        mcp.add_tool(tool)
  • The get_cluster_health_and_services function is included in the ALL_TOOLS list, which is used for bulk registration of all tools.
    get_cluster_health_and_services,
  • Import of the get_cluster_health_and_services handler from the server module into the tools package.
    get_cluster_health_and_services,
Behavior4/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 effectively describes key behaviors: it performs active pinging for health checks, returns latency information, shows connection status and node details, and explains how the bucket_name parameter changes the perspective of the ping. It does not cover aspects like rate limits, authentication needs, or error handling, but provides substantial operational context.

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 well-structured and front-loaded with the core purpose, followed by bullet points detailing functionalities, conditional parameter behavior, and return values. Every sentence adds value without redundancy, making it efficient and easy to parse.

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 the tool's complexity (health monitoring with conditional behavior), no annotations, and an output schema (which handles return value documentation), the description is complete. It covers purpose, usage, parameter semantics, and behavioral traits adequately, leaving output details to the structured schema.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must fully compensate. It clearly explains the semantics of the single parameter (bucket_name): if provided, it pings services from the bucket's perspective; otherwise, it uses cluster-level ping. This adds crucial meaning beyond the schema's basic type information.

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?

The description clearly states the tool's purpose with specific verbs ('get', 'list', 'show') and resources ('cluster health status', 'running services'), distinguishing it from sibling tools like 'test_cluster_connection' (which tests connectivity) or 'get_server_configuration_status' (which focuses on configuration). It explicitly covers both health monitoring and service listing functions.

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?

The description provides clear context for when to use the tool (health monitoring and service listing) and explains the conditional behavior based on the bucket_name parameter. However, it does not explicitly state when NOT to use it or name specific alternatives among the sibling tools, such as 'test_cluster_connection' for basic connectivity checks.

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/Couchbase-Ecosystem/mcp-server-couchbase'

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