BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/simple-ai/firecrawl-tool

firecrawl-tool

simple-ai/firecrawl-tool
FreeUtility

A tool for searching and scraping the web using Firecrawl.

Live preview

live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://simple-ai.dev/r/firecrawl-tool.json

Source

./src/registry/ai/tools/firecrawl-tool.tssimple-ai.dev/r/firecrawl-tool.json
1import { FirecrawlAppV1 as FirecrawlApp } from "@mendable/firecrawl-js";
2import { type InferUITool, tool } from "ai";
3import { z } from "zod";
4
5const firecrawlParamsSchema = z.object({
6 mode: z
7 .enum(["search", "scrape"])
8 .describe(
9 "The operation to perform: 'search' for general queries, 'scrape' for a specific URL",
10 ),
11 query: z
12 .string()
13 .describe("The search query or the specific URL to scrape"),
14});
15
16export type FirecrawlParams = z.infer<typeof firecrawlParamsSchema>;
17
18const firecrawlResultSchema = z.union([
19 z.object({
20 success: z.literal(true),
21 markdown: z.string(),
22 }),
23 z.object({
24 success: z.literal(true),
25 documents: z.array(z.any()),
26 }),
27 z.object({
28 success: z.literal(false),
29 error: z.string(),
30 }),
31]);
32
33export type FirecrawlResult = z.infer<typeof firecrawlResultSchema>;
34
35export const firecrawlTool = tool({
36 name: "firecrawl",
37 description:
38 "Search the web or scrape a specific URL using Firecrawl. Use this to find live information.",
39 inputSchema: firecrawlParamsSchema,
40 outputSchema: firecrawlResultSchema,
41 execute: async (params) => {
42 const apiKey = process.env.FIRECRAWL_API_KEY;
43
44 if (!apiKey) {
45 return { success: false, error: "FIRECRAWL_API_KEY is not set" };
46 }
47
48 try {
49 const app = new FirecrawlApp({ apiKey });
50
51 if (params.mode === "scrape") {
52 const scrapeResult = await app.scrapeUrl(params.query, {
53 formats: ["markdown"],
54 });
55
56 if (!scrapeResult.success) {
57 return {
58 success: false,
59 error: `Failed to scrape: ${scrapeResult.error || "Unknown error"}`,
60 };
61 }
62
63 return { success: true, markdown: scrapeResult.markdown };
64 } else {
65 const searchResult = await app.search(params.query, {
66 limit: 3,
67 scrapeOptions: {
68 formats: ["markdown"],
69 },
70 });
71
72 if (!searchResult.success) {
73 return {
74 success: false,
75 error: `Failed to search: ${searchResult.error || "Unknown error"}`,
76 };
77 }
78
79 return { success: true, documents: searchResult.data };
80 }
81 } catch (error) {
82 return {
83 success: false,
84 error:
85 error instanceof Error
86 ? error.message
87 : "Unknown error occurred",
88 };
89 }
90 },
91});
92
93export type FirecrawlTool = InferUITool<typeof firecrawlTool>;

What it pulls in

npm packages

  • ai
  • @mendable/firecrawl-js
  • zod

Files it writes

  • ./src/registry/ai/tools/firecrawl-tool.ts

Facts

Registry
simple-ai
Type
registry:lib
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on simple-ai simple-ai.dev Alwurts/simple-ai on GitHub Raw registry item This item as JSON

More from simple-ai

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
agent-respondagent-respondsimple-aiUtilitiesFree1 dep
agents-tools-registryagents-tools-registrysimple-aiUtilitiesFree1 dep · 2 files
ai-utilsai-utilssimple-aiUtilitiesFree1 dep
Exa Agentexa-agentsimple-aiUtilitiesFree1 dep
exa-toolexa-toolsimple-aiUtilitiesFree3 deps
Firecrawl Agentfirecrawl-agentsimple-aiUtilitiesFree1 dep
get-weatherget-weathersimple-aiUtilitiesFree2 deps
id-to-readable-textid-to-readable-textsimple-aiUtilitiesFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex