list_cards
Retrieve all saved questions and cards from Metabase with their metadata. Use this to access an overview of your analytics assets for inventory, auditing, or automation.
Instructions
List all saved questions/cards in Metabase.
Returns: Dictionary containing all cards with their metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:427-444 (handler)The handler function for the 'list_cards' tool. It fetches all saved questions/cards from Metabase by making a GET request to /api/card and returns the JSON response containing card metadata.
@mcp.tool async def list_cards(ctx: Context) -> dict[str, Any]: """ List all saved questions/cards in Metabase. Returns: Dictionary containing all cards with their metadata. """ try: await ctx.info("Fetching list of saved cards/questions") result = await metabase_client.request("GET", "/card") card_count = len(result) if isinstance(result, list) else len(result.get("data", [])) await ctx.info(f"Successfully retrieved {card_count} cards") return result except Exception as e: error_msg = f"Error listing cards: {e}" await ctx.error(error_msg) raise ToolError(error_msg) from e - server.py:427-428 (registration)The tool is registered with the FastMCP server via the @mcp.tool decorator on the list_cards function.
@mcp.tool async def list_cards(ctx: Context) -> dict[str, Any]: