Skip to main content
Glama

get_collections_in_scope

Retrieve all collection names within a specified Couchbase scope and bucket to manage database organization and access.

Instructions

Get the names of all collections in the given scope and bucket.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes
scope_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the tool logic. It runs a query on system:all_keyspaces to fetch distinct collection names for the given bucket and scope.
    def get_collections_in_scope(
        ctx: Context, bucket_name: str, scope_name: str
    ) -> list[str]:
        """Get the names of all collections in the given scope and bucket."""
    
        # Get the collections in the scope using system:all_keyspaces collection
        query = "SELECT DISTINCT(name) as collection_name FROM system:all_keyspaces where `bucket`=$bucket_name and `scope`=$scope_name"
        results = run_cluster_query(
            ctx, query, bucket_name=bucket_name, scope_name=scope_name
        )
        return [result["collection_name"] for result in results]
  • Registers the get_collections_in_scope tool (along with others) by adding each tool from ALL_TOOLS to the FastMCP server instance.
    # Register all tools
    for tool in ALL_TOOLS:
        mcp.add_tool(tool)
  • Includes get_collections_in_scope in the ALL_TOOLS list used for registration.
    get_collections_in_scope,
  • Imports get_collections_in_scope from .server module for exposure.
    get_collections_in_scope,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' names, implying a read-only operation, but doesn't mention permissions, rate limits, error handling, or output format. This leaves significant gaps for a tool with two required parameters.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple retrieval tool.

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's low complexity (two parameters, no nested objects) and the presence of an output schema, the description is minimally adequate. However, with no annotations and 0% schema description coverage, it should provide more context on usage and behavior to fully guide the agent.

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?

The description mentions 'given scope and bucket', which aligns with the two parameters 'scope_name' and 'bucket_name', but adds no semantic details beyond what the schema titles provide. With 0% schema description coverage, the description partially compensates by referencing the parameters, but doesn't explain their roles or constraints.

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 verb 'Get' and the resource 'names of all collections', specifying the scope and bucket context. It distinguishes from siblings like 'get_scopes_and_collections_in_bucket' by focusing only on collections within a given scope, though it doesn't explicitly compare them.

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_scopes_in_bucket'. The description implies usage for retrieving collection names but doesn't specify prerequisites, exclusions, or comparative contexts.

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