list_saved_funnels
Retrieve saved funnel analyses from your Mixpanel project to identify existing funnels and obtain their IDs for detailed examination.
Instructions
List available saved funnels in the project. Useful for discovering existing funnel analyses and getting funnel IDs for further analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | The Mixpanel project ID. Optional since it has a default. |
Implementation Reference
- src/index.ts:1102-1149 (handler)The handler function that implements the core logic for the 'list_saved_funnels' tool. It makes an authenticated GET request to Mixpanel's /funnels/list endpoint to retrieve saved funnels for the specified project.async function handleListSavedFunnels(args: any, config: any) { const { project_id = config.DEFAULT_PROJECT_ID } = args; try { const credentials = `${config.SERVICE_ACCOUNT_USER_NAME}:${config.SERVICE_ACCOUNT_PASSWORD}`; const encodedCredentials = Buffer.from(credentials).toString('base64'); const url = `${config.MIXPANEL_BASE_URL}/funnels/list?project_id=${project_id}`; const options = { method: 'GET', headers: { 'accept': 'application/json', 'authorization': `Basic ${encodedCredentials}` } }; const response = await fetch(url, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`HTTP error! status: ${response.status} - ${errorText}`); } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; } catch (error: unknown) { console.error("Error listing saved funnels:", error); const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error listing saved funnels: ${errorMessage}` } ], isError: true }; } }
- src/index.ts:485-497 (schema)The tool definition in the ListTools response, including the name, description, and input schema which defines the optional project_id parameter.{ name: "list_saved_funnels", description: "List available saved funnels in the project. Useful for discovering existing funnel analyses and getting funnel IDs for further analysis.", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "The Mixpanel project ID. Optional since it has a default." } } } },
- src/index.ts:632-633 (registration)The dispatch case in the CallToolRequestSchema handler that routes calls to 'list_saved_funnels' to the handleListSavedFunnels function.case "list_saved_funnels": return await handleListSavedFunnels(args, { SERVICE_ACCOUNT_USER_NAME, SERVICE_ACCOUNT_PASSWORD, DEFAULT_PROJECT_ID, MIXPANEL_BASE_URL });