MCPcopy
hub / github.com/cloudflare/mcp-server-cloudflare / resolveAndInvoke

Function resolveAndInvoke

apps/radar/src/utils.ts:12–17  ·  view source on GitHub ↗
(client: any, path: string, params: any)

Source from the content-addressed store, hash-verified

10 * @returns {Promise<any>} The result of the method invocation.
11 */
12export async function resolveAndInvoke(client: any, path: string, params: any): Promise<any> {
13 const slugs = path.split('/')
14 const method = slugs.reduce((acc, key) => acc?.[key], client)
15 const parentContext = slugs.slice(0, -1).reduce((acc, key) => acc?.[key], client)
16 return await method.bind(parentContext)(params)
17}

Callers 1

registerRadarToolsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected