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

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,

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