Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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
  • 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)
  • 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, )
  • 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, ]

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