Skip to main content
Glama
MikelA92
by MikelA92

list_segments

Retrieve all saved filter segments from Metabase to reuse predefined filters like Active Users or Premium Customers across your analytics queries.

Instructions

🎯 [SAFE] List all segments (saved filters) in Metabase. Segments are reusable filters like "Active Users" or "Premium Customers". Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that fetches segments from Metabase API endpoint '/api/segment' and formats them into a readable text list.
    async listSegments() { this.logger.debug('Listing segments'); const segments = await this.apiClient.makeRequest('/api/segment'); return { content: [ { type: 'text', text: `Segments: ${segments.map(s => `- ID: ${s.id} | Name: ${s.name} | Table: ${s.table?.name}${s.description ? ` | ${s.description}` : ''}` ).join('\n')}`, }, ], }; }
  • JSON schema definition for the 'list_segments' tool, specifying no input parameters are required.
    name: 'list_segments', description: '🎯 [SAFE] List all segments (saved filters) in Metabase. Segments are reusable filters like "Active Users" or "Premium Customers". Risk: None - read-only operation.', inputSchema: { type: 'object', properties: {}, }, },
  • Registration of the 'list_segments' tool in the main server's executeTool switch statement, delegating to the handler instance.
    case 'list_segments': return await this.segmentMetricHandlers.listSegments();

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