Skip to main content
Glama

test_cluster_connection

Verify and establish the connection to a Couchbase cluster and bucket, retrieving connection status and essential cluster information for operational readiness.

Instructions

Test the connection to Couchbase cluster and bucket. This tool verifies the connection to the Couchbase cluster and bucket by establishing the connection if it is not already established. Returns connection status and basic cluster information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler function that tests the connection to the Couchbase cluster and optionally to a specific bucket by calling get_cluster_connection and connect_to_bucket.
    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", }
  • Registers all tools from ALL_TOOLS, including test_cluster_connection, using mcp.add_tool(tool).
    # Register all tools for tool in ALL_TOOLS: mcp.add_tool(tool)
  • Imports and includes test_cluster_connection in the ALL_TOOLS list for easy registration in the MCP server.
    # List of all tools for easy registration ALL_TOOLS = [ get_buckets_in_cluster, get_server_configuration_status, test_cluster_connection, get_scopes_and_collections_in_bucket, get_collections_in_scope, get_scopes_in_bucket, get_document_by_id, upsert_document_by_id, delete_document_by_id, get_schema_for_collection, run_sql_plus_plus_query, get_index_advisor_recommendations, list_indexes, get_cluster_health_and_services, ]

Other Tools

Related 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