Skip to main content
Glama
voducdan

metabase-mcp

by voducdan

list_collections

List all Metabase collections accessible to the current user with optional filters for archived status, namespace, and personal collections.

Instructions

List all collections in Metabase that the current user has read permissions for.

Args: archived: If true, return only archived collections. exclude_other_user_collections: If true, hide other users' personal collections. namespace: Filter collections by namespace (e.g. "snippets" for snippet folders). personal_only: If true, return only personal collections (where personal_owner_id is not null).

Returns: Dictionary containing all collections with their metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
exclude_other_user_collectionsNo
namespaceNo
personal_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'list_collections' tool handler function. Decorated with @mcp.tool, it calls the Metabase API GET /collection with optional query parameters (archived, exclude_other_user_collections, namespace, personal_only) and returns a dictionary of collections.
    @mcp.tool
    async def list_collections(
        ctx: Context,
        archived: bool = False,
        exclude_other_user_collections: bool = False,
        namespace: str | None = None,
        personal_only: bool = False,
    ) -> dict[str, Any]:
        """
        List all collections in Metabase that the current user has read permissions for.
    
        Args:
            archived: If true, return only archived collections.
            exclude_other_user_collections: If true, hide other users' personal collections.
            namespace: Filter collections by namespace (e.g. "snippets" for snippet folders).
            personal_only: If true, return only personal collections (where personal_owner_id is not null).
    
        Returns:
            Dictionary containing all collections with their metadata.
        """
        try:
            await ctx.info("Fetching list of collections")
            query_params: dict[str, Any] = {}
            if archived:
                query_params["archived"] = "true"
            if exclude_other_user_collections:
                query_params["exclude-other-user-collections"] = "true"
            if namespace is not None:
                query_params["namespace"] = namespace
            if personal_only:
                query_params["personal-only"] = "true"
            result = await metabase_client.request("GET", "/collection", params=query_params or None)
            if isinstance(result, list):
                collection_count = len(result)
                await ctx.info(f"Successfully retrieved {collection_count} collections")
                return {"data": result, "total": collection_count}
            collection_count = len(result.get("data", []))
            await ctx.info(f"Successfully retrieved {collection_count} collections")
            return result
        except Exception as e:
            error_msg = f"Error listing collections: {e}"
            await ctx.error(error_msg)
            raise ToolError(error_msg) from e
  • server.py:1825-1826 (registration)
    The @mcp.tool decorator on the list_collections function registers this tool with the FastMCP server.
    @mcp.tool
    async def list_collections(
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explicitly states that only collections the current user has read permissions for are returned, explains all four parameters (archived, exclude_other_user_collections, namespace, personal_only), and describes the return type. However, it does not disclose rate limits or error conditions.

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 two concise paragraphs: one for purpose and one for parameters/returns. It uses a clear docstring-style list for Args and Returns, with no superfluous words. Every sentence adds value.

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

Completeness5/5

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

The tool has 4 optional parameters explained fully, an output schema exists (so return details are not required), and the description covers both input and output adequately. It provides enough context for an agent to invoke the tool correctly without ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% coverage (no descriptions in schema), so the description compensates fully by explaining each parameter in detail. The Args section provides clear semantics for 'archived', 'exclude_other_user_collections', 'namespace', and 'personal_only', which are absent from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all collections') and the resource ('collections in Metabase') with a specific scope ('that the current user has read permissions for'). It distinguishes itself from sibling tools like 'create_collection' by being a read-only list operation.

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

Usage Guidelines3/5

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

The description implicitly indicates usage for listing viewable collections but does not provide explicit guidance on when to use this tool versus alternatives or when not to use it. No alternative tools are mentioned, though the sibling list includes related tools.

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/voducdan/matebase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server