Clone a function and retain a reusable closure reference
clone-functionClone a Luau function and return a reusable reference for later MCP calls, since function values cannot be passed through JSON.
Instructions
Clone a function with clonefunction/clonefunc. The function result is retained in getgenv().__mcp_closure_refs and returned as a reusable Reference expression because functions cannot cross JSON. Signature: { functionPath: string, threadContext: number?, key: any? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. Produces: created-handle. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Optional stable key for getgenv().__mcp_closure_refs. Generated when omitted. | |
| functionPath | Yes | Luau expression resolving to the target function. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |