Skip to main content
Glama

get_scopes_in_bucket

Retrieve all scope names from a specified Couchbase bucket to organize and access data collections within the database.

Instructions

Get the names of all scopes in the given bucket.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that implements the logic to retrieve all scope names from a specified Couchbase bucket using the cluster connection and bucket collections API.
    def get_scopes_in_bucket(ctx: Context, bucket_name: str) -> list[str]:
        """Get the names of all scopes in the given bucket."""
        cluster = get_cluster_connection(ctx)
        bucket = connect_to_bucket(cluster, bucket_name)
        try:
            scopes = bucket.collections().get_all_scopes()
            return [scope.name for scope in scopes]
        except Exception as e:
            logger.error(f"Error getting scopes in the bucket {bucket_name}: {e}")
            raise
  • The tool function is included in the ALL_TOOLS list, which is used for registering all available MCP tools with the 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,
    ]
  • Import of the get_scopes_in_bucket handler from the server module into the tools package for exposure and 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,
    )
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't mention whether this is a read-only operation, potential permissions needed, rate limits, error conditions, or what happens if the bucket doesn't exist. The description only covers basic functionality without operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core functionality without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values) and only one simple parameter, the description is minimally adequate. However, for a tool with no annotations and 0% schema description coverage, it should provide more context about behavior and usage compared to sibling tools.

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%, but the description mentions 'given bucket' which aligns with the single 'bucket_name' parameter. However, it doesn't add meaningful semantics beyond what's implied by the parameter name - no format requirements, constraints, or examples are provided.

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 action ('Get') and resource ('names of all scopes in the given bucket'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_scopes_and_collections_in_bucket', which provides similar but broader scope information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_scopes_and_collections_in_bucket' or 'get_collections_in_scope'. The description only states what it does without context about prerequisites, limitations, or comparison to siblings.

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