get_buckets_in_cluster
Retrieve the names of all accessible buckets in a Couchbase cluster to identify available data containers for querying or management.
Instructions
Get the names of all the accessible buckets in the cluster.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/server.py:105-115 (handler)The main handler function for the 'get_buckets_in_cluster' tool. It retrieves the cluster connection and lists all accessible bucket names using the Couchbase SDK.def get_buckets_in_cluster(ctx: Context) -> list[str]: """Get the names of all the accessible buckets in the cluster.""" cluster = get_cluster_connection(ctx) bucket_manager = cluster.buckets() buckets_with_settings = bucket_manager.get_all_buckets() buckets = [] for bucket in buckets_with_settings: buckets.append(bucket.name) return buckets
- src/mcp_server.py:176-177 (registration)Registration of all tools, including 'get_buckets_in_cluster', to the FastMCP server instance via a loop over ALL_TOOLS.for tool in ALL_TOOLS: mcp.add_tool(tool)
- src/tools/__init__.py:31-39 (registration)Import of the 'get_buckets_in_cluster' handler from the server module into the tools package, making it available for inclusion in ALL_TOOLS.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, )
- src/tools/__init__.py:42-64 (registration)The ALL_TOOLS list that includes 'get_buckets_in_cluster' for bulk registration in the MCP server.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, get_queries_not_selective, get_queries_not_using_covering_index, get_queries_using_primary_index, get_queries_with_large_result_count, get_queries_with_largest_response_sizes, get_longest_running_queries, get_most_frequent_queries, ]