Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

list_collections

Retrieve all collections (folders) in Metabase to understand how cards and dashboards are organized within your instance.

Instructions

📁 [SAFE] List all collections (folders) in Metabase. Collections organize cards and dashboards. Use this to understand the organizational structure. Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNoOptional namespace filter (e.g., "snippets")

Implementation Reference

  • The `listCollections` method implements the core logic of the 'list_collections' tool. It fetches collections from the Metabase API (optionally filtered by namespace) and formats them as a markdown list in the tool response.
      async listCollections(namespace = null) {
        this.logger.debug('Listing collections', { namespace });
        
        const params = namespace ? new URLSearchParams({ namespace }) : '';
        const collections = await this.apiClient.makeRequest(`/api/collection/${params ? '?' + params : ''}`);
        
        return {
          content: [
            {
              type: 'text',
              text: `Collections:
    ${collections.map(c => 
      `- ID: ${c.id} | Name: ${c.name}${c.description ? ` | ${c.description}` : ''}`
    ).join('\n')}`,
            },
          ],
        };
      }
  • Tool schema definition including name, description, and inputSchema for 'list_collections', provided to MCP clients via list_tools.
    {
      name: 'list_collections',
      description: '📁 [SAFE] List all collections (folders) in Metabase. Collections organize cards and dashboards. Use this to understand the organizational structure. Risk: None - read-only operation.',
      inputSchema: {
        type: 'object',
        properties: {
          namespace: {
            type: 'string',
            description: 'Optional namespace filter (e.g., "snippets")',
          },
        },
      },
    },
  • Registration/dispatch of the 'list_collections' tool call to the CollectionHandlers.listCollections method in the MCP server's executeTool switch statement.
    case 'list_collections':
      return await this.collectionHandlers.listCollections(args.namespace);
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 of behavioral disclosure. It effectively adds context by explicitly stating it's a 'read-only operation' and 'Risk: None', which informs the agent about safety and permissions. However, it doesn't describe potential limitations like pagination, rate limits, or response format details.

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 efficiently structured with three sentences: purpose, context, and risk. Each sentence adds value without redundancy, and it's front-loaded with the core functionality. The use of emoji and bracketed labels ('[SAFE]') enhances readability without wasting space.

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?

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is reasonably complete. It covers purpose, usage context, and safety, but lacks details on output format or behavioral constraints like response size. For a simple read operation, this is adequate though not exhaustive.

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?

Schema description coverage is 100%, so the schema already documents the single optional parameter 'namespace'. The description does not add any parameter-specific information beyond what the schema provides, such as examples of namespaces or when filtering is useful. Baseline 3 is appropriate when the schema handles parameter documentation.

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 specific action ('List all collections'), identifies the resource ('collections (folders) in Metabase'), and explains their purpose ('organize cards and dashboards'). It distinguishes from siblings by focusing on collections rather than cards, dashboards, or other resources listed in sibling tools.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('to understand the organizational structure'), but does not explicitly mention when not to use it or name specific alternatives. It implies usage for browsing collections rather than querying or managing items, which helps differentiate from tools like get_collection_items or list_cards.

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/MikelA92/metabase-mcp-mab'

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