Skip to main content
Glama
voducdan

metabase-mcp

by voducdan

list_dashboard_tabs

Get all tabs configured on a dashboard by providing its ID. Returns a list of tab objects with id, name, and position.

Instructions

List all tabs configured on a dashboard.

Args: dashboard_id: The ID of the dashboard.

Returns: A list of tab objects with id, name, and position. Empty list if the dashboard has no tabs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dashboard_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async function `list_dashboard_tabs` is the tool handler implementation. It fetches dashboard data from Metabase API (GET /dashboard/{dashboard_id}), extracts the 'tabs' list, and returns a list of dicts with tab_id, name, and position for each tab.
    @mcp.tool
    async def list_dashboard_tabs(dashboard_id: int, ctx: Context) -> list[dict[str, Any]]:
        """
        List all tabs configured on a dashboard.
    
        Args:
            dashboard_id: The ID of the dashboard.
    
        Returns:
            A list of tab objects with id, name, and position. Empty list if the
            dashboard has no tabs.
        """
        try:
            await ctx.info(f"Fetching tabs for dashboard {dashboard_id}")
            result = await metabase_client.request("GET", f"/dashboard/{dashboard_id}")
    
            tabs = result.get("tabs") or []
            await ctx.info(
                f"Successfully retrieved {len(tabs)} tabs from dashboard {dashboard_id}"
            )
    
            return [
                {
                    "tab_id": tab.get("id"),
                    "name": tab.get("name"),
                    "position": tab.get("position"),
                }
                for tab in tabs
            ]
        except Exception as e:
            error_msg = f"Error fetching tabs for dashboard {dashboard_id}: {e}"
            await ctx.error(error_msg)
            raise ToolError(error_msg) from e
  • server.py:1480-1481 (registration)
    The `@mcp.tool` decorator on line 1480 registers the `list_dashboard_tabs` function as a FastMCP tool.
    @mcp.tool
    async def list_dashboard_tabs(dashboard_id: int, ctx: Context) -> list[dict[str, Any]]:
  • The docstring serves as the tool's schema/definition, describing the input parameter (dashboard_id: int) and return type (list of tab objects with id, name, position).
    """
    List all tabs configured on a dashboard.
    
    Args:
        dashboard_id: The ID of the dashboard.
    
    Returns:
        A list of tab objects with id, name, and position. Empty list if the
        dashboard has no tabs.
    """
Behavior4/5

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

No annotations provided, but the description explains the return value (list of tab objects with id, name, position) and edge cases (empty list). It lacks information on error handling or permissions.

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 concise with two sentences and a structured Args/Returns section, front-loaded with the main purpose. No unnecessary words.

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?

Given the tool's simplicity (one parameter, no nested objects) and the presence of an output schema, the description covers input, output format, and edge cases completely.

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?

The description adds meaning for the single parameter dashboard_id, explaining its role. This compensates for the 0% schema description coverage.

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 it lists all tabs on a dashboard, with a specific verb and resource. It distinguishes itself from siblings like list_dashboards and list_dashboard_tab_cards.

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 implies usage when needing to retrieve tab information, but does not explicitly state when to use it versus alternatives or provide prerequisites.

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