Skip to main content
Glama
MikelA92
by MikelA92

list_collections

Retrieve all collections (folders) from 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 handler function that executes the list_collections tool: fetches collections from Metabase API via apiClient and formats them as a text 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')}`, }, ], }; }
  • The input schema and description for the list_collections tool, defining optional namespace parameter.
    { 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 of the list_collections tool in the MCP server's tool execution switch statement, delegating to collectionHandlers.
    case 'list_collections': return await this.collectionHandlers.listCollections(args.namespace);
  • Instantiation of the CollectionHandlers class used for list_collections and related tools.
    this.collectionHandlers = new CollectionHandlers(this.apiClient);

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