+ Many tools require API keys (e.g., Firecrawl, Exa). The recommended approach is to
+ wrap registryExecuteTool with your
+ pre-configured keys.
+
+
+
+ {/* Wrapper */}
+
+
+ Create a Wrapper (Recommended)
+
+ = {
+ FIRECRAWL_API_KEY: process.env.FIRECRAWL_API_KEY!,
+ EXA_API_KEY: process.env.EXA_API_KEY!,
+};
+
+// Create a wrapped version that auto-injects keys
+export const registryExecute = tool({
+ description: registryExecuteTool.description,
+ parameters: registryExecuteTool.parameters,
+ execute: async ({ toolId, params }) => {
+ return registryExecuteTool.execute({ toolId, params, env: API_KEYS });
+ },
+});`}
+ />
+
+
+ {/* Usage */}
+
+
Use the Wrapped Tool
+
+
+
+ {/* How it works */}
+
+
How It Works
+
+ -
+
registrySearch returns{' '}
+ requiredEnvVars for each tool (e.g.,{' '}
+ ["FIRECRAWL_API_KEY"])
+
+ - Your wrapper automatically passes all configured keys to the executor
+ -
+ The executor injects matching keys as environment variables in the sandbox
+
+ - Tools without required keys work with or without the wrapper
+
+
+
+