list_saved_funnels
Retrieve saved funnel analyses from Mixpanel projects to discover existing funnel metrics and obtain funnel 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)Handler function that executes the list_saved_funnels tool: authenticates with Mixpanel using service account credentials, performs a GET request to /funnels/list endpoint, returns JSON data or error message.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)Tool schema definition including inputSchema for project_id (optional), used when listing available tools.{ 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-634 (registration)Registration in the tool dispatch switch case: maps tool name to the handleListSavedFunnels handler.case "list_saved_funnels": return await handleListSavedFunnels(args, { SERVICE_ACCOUNT_USER_NAME, SERVICE_ACCOUNT_PASSWORD, DEFAULT_PROJECT_ID, MIXPANEL_BASE_URL });
- src/index.ts:596-597 (registration)The tools array where list_saved_funnels is registered for the ListTools endpoint.] };