Skip to main content
Glama
MikelA92
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);

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