Skip to main content
Glama

test_cluster_connection

Verify connectivity to a Couchbase cluster and optionally test bucket access to ensure the MCP server can interact with your database.

Instructions

Test the connection to Couchbase cluster and optionally to a bucket. This tool verifies the connection to the Couchbase cluster and bucket by establishing the connection if it is not already established. If bucket name is not provided, it will not try to connect to the bucket specified in the MCP server settings. Returns connection status and basic cluster information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'test_cluster_connection' tool. It tests the connection to the Couchbase cluster and optionally a specific bucket, returning status information.
    def test_cluster_connection(
        ctx: Context, bucket_name: str | None = None
    ) -> dict[str, Any]:
        """Test the connection to Couchbase cluster and optionally to a bucket.
        This tool verifies the connection to the Couchbase cluster and bucket by establishing the connection if it is not already established.
        If bucket name is not provided, it will not try to connect to the bucket specified in the MCP server settings.
        Returns connection status and basic cluster information.
        """
        try:
            cluster = get_cluster_connection(ctx)
            bucket = None
            if bucket_name:
                bucket = connect_to_bucket(cluster, bucket_name)
    
            return {
                "status": "success",
                "cluster_connected": cluster.connected,
                "bucket_connected": bucket is not None,
                "bucket_name": bucket_name,
                "message": "Successfully connected to Couchbase cluster",
            }
        except Exception as e:
            return {
                "status": "error",
                "cluster_connected": False,
                "bucket_connected": False,
                "bucket_name": bucket_name,
                "error": str(e),
                "message": "Failed to connect to Couchbase cluster",
            }
  • The registration code where all tools, including 'test_cluster_connection', are added to the FastMCP server instance by iterating over ALL_TOOLS.
    for tool in ALL_TOOLS:
        mcp.add_tool(tool)
  • Import of the 'test_cluster_connection' handler from server.py into the tools __init__.py, making it available in ALL_TOOLS for registration.
    from .server import (
        get_buckets_in_cluster,
        get_cluster_health_and_services,
        get_collections_in_scope,
        get_scopes_and_collections_in_bucket,
        get_scopes_in_bucket,
        get_server_configuration_status,
        test_cluster_connection,
    )
  • Inclusion of 'test_cluster_connection' in the ALL_TOOLS list used for server registration.
    test_cluster_connection,
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool 'verifies the connection' and 'establishing the connection if it is not already established,' indicating it may initiate connections. It also mentions return values ('connection status and basic cluster information'). However, it lacks details on error handling, timeouts, or authentication requirements, which are important for a connection-testing tool.

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 (4 sentences) and front-loaded with the core purpose. Each sentence adds value: purpose, behavior, parameter effect, and return values. There's minimal redundancy, though the second sentence could be more concise by combining with the first.

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?

Given the tool's moderate complexity (connection testing with one optional parameter), no annotations, and an output schema (which handles return values), the description is reasonably complete. It covers purpose, parameter semantics, and behavioral aspects like connection establishment. However, it could improve by addressing error scenarios or linking to sibling tools for more detailed diagnostics.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It explains the 'bucket_name' parameter: 'optionally to a bucket' and 'If bucket name is not provided, it will not try to connect to the bucket.' This adds meaning beyond the schema's title ('Bucket Name') by clarifying its optional nature and effect on behavior. However, it doesn't detail format constraints or examples, leaving some ambiguity.

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: 'Test the connection to Couchbase cluster and optionally to a bucket.' It specifies the verb ('test'), resource ('connection'), and scope ('cluster and optionally bucket'), distinguishing it from sibling tools that focus on data operations or health checks. However, it doesn't explicitly differentiate from 'get_cluster_health_and_services', which might overlap in cluster status reporting.

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 usage context: 'If bucket name is not provided, it will not try to connect to the bucket specified in the MCP server settings.' This suggests when to use the optional parameter but lacks explicit guidance on when to choose this tool over alternatives like 'get_cluster_health_and_services' or other diagnostic tools. No exclusions or prerequisites are mentioned.

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