Implement maxAge fast scraping parameter#72
Closed
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Closed
Implement maxAge fast scraping parameter#72devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
- Add maxAge parameter to SCRAPE_TOOL input schema - Add maxAge to CRAWL_TOOL scrapeOptions for faster crawling - Create missing BATCH_SCRAPE_TOOL with maxAge support - Add maxAge to SEARCH_TOOL scrapeOptions - Ensure maxAge is passed through to all Firecrawl API calls Fixes #69 Co-Authored-By: Nick <nicolascamara29@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement maxAge fast scraping parameter
Summary
This PR implements the
maxAgefast scraping parameter across all scraping-related tools in the Firecrawl MCP Server, enabling 500% faster scraping through intelligent caching as documented in PR #34 of firecrawl-docs.Key Changes:
maxAgeparameter (number, defaults to 0) to SCRAPE_TOOL, CRAWL_TOOL, and SEARCH_TOOL schemasThe maxAge parameter accepts milliseconds and uses cached content if younger than the specified age, otherwise scrapes fresh content. A value of 0 (default) means always scrape fresh.
Review & Testing Checklist for Human
Recommended test plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD subgraph "MCP Server Structure" Index["src/index.ts"]:::major-edit Tests["src/index.test.ts"]:::context end subgraph "Tool Definitions (Updated)" SCRAPE["SCRAPE_TOOL<br/>+maxAge param"]:::major-edit CRAWL["CRAWL_TOOL<br/>+maxAge in scrapeOptions"]:::major-edit SEARCH["SEARCH_TOOL<br/>+maxAge in scrapeOptions"]:::minor-edit BATCH["BATCH_SCRAPE_TOOL<br/>**NEW TOOL**"]:::major-edit end subgraph "API Handlers (Updated)" Handler["CallToolRequestSchema<br/>+batch_scrape case"]:::major-edit TypeGuards["Type Guards<br/>+isBatchScrapeOptions"]:::minor-edit end subgraph "Firecrawl Client Calls" ScrapeCall["client.scrapeUrl()"]:::context CrawlCall["client.asyncCrawlUrl()"]:::context BatchCall["client.asyncBatchScrapeUrls()"]:::context SearchCall["client.search()"]:::context end Index --> SCRAPE Index --> CRAWL Index --> SEARCH Index --> BATCH Index --> Handler Index --> TypeGuards Handler --> ScrapeCall Handler --> CrawlCall Handler --> BatchCall Handler --> SearchCall Tests -.-> BATCH subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
origin: 'mcp-server'parameter from batch scrape call due to type compatibility issuesSession Info: