firecrawl_scrape
Extract clean, structured content from any URL with JavaScript rendering and bypass common blocks. Returns markdown optimized for LLM processing.
Instructions
Scrape a single URL and extract clean, structured content. Handles JavaScript rendering and bypasses common blocks. Returns markdown optimized for LLMs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to scrape | |
| formats | No | Output formats (default: ['markdown']) | |
| onlyMainContent | No | Extract only main content, skip nav/footer (default true) | |
| waitFor | No | Wait milliseconds for JS rendering |
Implementation Reference
- src/tools/firecrawl.ts:5-16 (registration)Definition and registration of the 'firecrawl_scrape' tool.
{ name: "firecrawl_scrape", description: "Scrape a single URL and extract clean, structured content. Handles JavaScript rendering and bypasses common blocks. Returns markdown optimized for LLMs.", inputSchema: z.object({ url: z.string().describe("URL to scrape"), formats: z.array(z.enum(["markdown", "html", "rawHtml", "links", "screenshot"])).optional() .describe("Output formats (default: ['markdown'])"), onlyMainContent: z.boolean().optional().describe("Extract only main content, skip nav/footer (default true)"), waitFor: z.number().optional().describe("Wait milliseconds for JS rendering"), }), endpoint: "/v1/firecrawl/scrape", }, - src/index.ts:14-39 (handler)The generic handler for all registered tools, including firecrawl_scrape. It uses gatewayRequest to fetch data from the API endpoint defined in tool configurations.
// Register all tools for (const tool of allTools) { server.tool( tool.name, tool.description, tool.inputSchema.shape, async (params) => { const method = tool.method || "POST"; const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>); if (result.error) { return { content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }], isError: true, }; } const text = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2); return { content: [{ type: "text" as const, text }], }; }, );