Skip to main content
Glama
illGATESmusic

ClickFunnels MCP Framework

ListfunnelsTool.js1.93 kB
import { MCPTool } from "mcp-framework"; import { z } from "zod"; import axios from "axios"; class ListfunnelsTool extends MCPTool { name = "listFunnels"; description = "List all available funnels in the ClickFunnels workspace"; schema = { limit: { type: z.number().optional(), description: "Maximum number of funnels to return (optional)", }, }; async execute(input) { try { const apiBase = process.env.CLICKFUNNELS_API_BASE; const workspaceId = process.env.CLICKFUNNELS_WORKSPACE_ID; const apiToken = process.env.CLICKFUNNELS_API_TOKEN; if (!apiBase || !workspaceId || !apiToken) { throw new Error("Missing required environment variables for ClickFunnels API"); } const params = {}; if (input.limit) { params.limit = input.limit.toString(); } const response = await axios.get(`${apiBase}/workspaces/${workspaceId}/funnels`, { headers: { Authorization: `Bearer ${apiToken}`, "Content-Type": "application/json", Accept: "application/json", }, params }); return response.data; } catch (error) { if (axios.isAxiosError(error)) { const statusCode = error.response?.status; const errorMessage = error.response?.data?.error || error.message; return { error: true, status: statusCode || 500, message: `Error listing funnels: ${errorMessage}`, }; } return { error: true, message: `Error listing funnels: ${error.message}`, }; } } } export default ListfunnelsTool;

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/illGATESmusic/click-funnels-mcp-shared'

If you have feedback or need assistance with the MCP directory API, please join our Discord server