Skip to main content
Glama
voducdan

metabase-mcp

by voducdan

create_collection

Create a new collection in Metabase to organize your data. Specify name, optional description, color, and parent collection ID.

Instructions

Create a new collection in Metabase.

Args: name: Name of the collection. description: Optional description. color: Optional color for the collection. parent_id: Optional parent collection ID.

Returns: The created collection object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
descriptionNo
colorNo
parent_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The create_collection tool handler: creates a new Metabase collection via POST /api/collection with optional name, description, color, and parent_id.
    @mcp.tool
    async def create_collection(
        name: str,
        ctx: Context,
        description: str | None = None,
        color: str | None = None,
        parent_id: int | None = None,
    ) -> dict[str, Any]:
        """
        Create a new collection in Metabase.
    
        Args:
            name: Name of the collection.
            description: Optional description.
            color: Optional color for the collection.
            parent_id: Optional parent collection ID.
    
        Returns:
            The created collection object.
        """
        try:
            await ctx.info(f"Creating new collection '{name}'")
    
            payload = {"name": name}
    
            if description:
                payload["description"] = description
            if color:
                payload["color"] = color
                await ctx.debug(f"Collection color: {color}")
            if parent_id is not None:
                payload["parent_id"] = parent_id
                await ctx.debug(f"Collection parent ID: {parent_id}")
    
            result = await metabase_client.request("POST", "/collection", json=payload)
            await ctx.info(f"Successfully created collection with ID {result.get('id')}")
    
            return result
        except Exception as e:
            error_msg = f"Error creating collection: {e}"
            await ctx.error(error_msg)
            raise ToolError(error_msg) from e
  • server.py:1870-1870 (registration)
    Registration of create_collection as an MCP tool via the @mcp.tool decorator.
    @mcp.tool
  • Docstring/input schema for create_collection defining parameters: name (required), description, color, parent_id (optional).
    """
    Create a new collection in Metabase.
    
    Args:
        name: Name of the collection.
        description: Optional description.
        color: Optional color for the collection.
        parent_id: Optional parent collection ID.
    
    Returns:
        The created collection object.
    """
Behavior3/5

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

No annotations are provided. The description implies mutation ('Create') and mentions the return object, but does not disclose permissions, uniqueness constraints, or side effects like whether parent_id is validated.

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 extremely concise: a one-line summary, structured Args list, and a Returns line. Every element is essential and front-loaded.

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

Completeness4/5

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

The description covers purpose, parameters, and return value. With a straightforward tool (no enums, few params) and an output schema existing, it is sufficiently complete, though potential edge cases (e.g., invalid parent_id) are not addressed.

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

Parameters4/5

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

Schema description coverage is 0%, so the description adds value by explaining each parameter (e.g., 'name: Name of the collection'). The explanations are clear and useful, though brief.

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 'Create a new collection in Metabase,' using a specific verb and resource. It distinguishes from sibling tools like create_card or create_dashboard.

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 lists parameters and their purposes, but provides no guidance on when to use this tool versus alternatives (e.g., list_collections) or what prerequisites exist (e.g., parent_id must exist).

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