agentic
agentic copied to clipboard
FireCrawl: SearchResponse type is not aligned with FireCrawl API response
When using the scrapeUrl tool, I get back a ScrapeResponse type:
export interface ScrapeResponse<
LLMResult = any,
ActionsSchema extends ActionsResult | never = never
> extends Document<LLMResult, ActionsSchema> {
success: true
warning?: string
error?: string
}
Yet, the server responds with data similar to SearchResponse - see their documentation:
export interface SearchResponse {
success: boolean
data: Document[] // <---- scraping has just a single document here, no array
warning?: string
error?: string
}
That's how I called the tool:
const scrapedData = await firecrawl.scrapeUrl({
url,
formats: ["markdown"],
});
Current workaround do access the Markdown, I need to access scrapedData.data.markdown which is not allowed by the type system (the typy system would support scrapeData.markdown, but this does not exist).
Hi @mjakl thank you for expressing this issue. I'll be helping this project out, but just getting ramped up. Here just leaving a comment that I hear you and will return shortly to address this issue fully 🙏