Skip to main content
Glama

mcp-server-cloudflare

Official
by cloudflare
utils.ts873 B
/** * Resolves and invokes a method dynamically based on the provided slugs. * * This function traverses the object based on the `slugs` array, binds the method * to its correct context, and invokes it with the provided parameters. * * @param {Object} client - The root object (e.g., `client.radar.http`) to resolve methods from. * @param {string[]} path - The path to the desired method. * @param {Object} params - The parameters to pass when invoking the resolved method. * @returns {Promise<any>} The result of the method invocation. */ export async function resolveAndInvoke(client: any, path: string, params: any): Promise<any> { const slugs = path.split('/') const method = slugs.reduce((acc, key) => acc?.[key], client) const parentContext = slugs.slice(0, -1).reduce((acc, key) => acc?.[key], client) return await method.bind(parentContext)(params) }

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/cloudflare/mcp-server-cloudflare'

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