mastra-ai/mastra · error · Error
Invalid arguments for firecrawl_check_crawl_status
Error message
Invalid arguments for firecrawl_check_crawl_status
What it means
The firecrawl_check_crawl_status branch validates args with `isStatusCheckOptions`, requiring an object with a string `id` (the crawl job ID). A failed guard throws before `client.checkCrawlStatus(args.id)` runs.
Source
Thrown at packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts:733
if (!response.success) {
throw new Error(response.error);
}
return {
content: [
{
type: 'text',
text: trimResponseText(`Started crawl for ${url} with job ID: ${response.id}`),
},
],
isError: false,
};
}
case 'firecrawl_check_crawl_status': {
if (!isStatusCheckOptions(args)) {
throw new Error('Invalid arguments for firecrawl_check_crawl_status');
}
const response = await client.checkCrawlStatus(args.id);
if (!response.success) {
throw new Error(response.error);
}
const status = `Crawl Status:
Status: ${response.status}
Progress: ${response.completed}/${response.total}
Credits Used: ${response.creditsUsed}
Expires At: ${response.expiresAt}
${response.data.length > 0 ? '\nResults:\n' + formatResults(response.data) : ''}`;
return {
content: [{ type: 'text', text: trimResponseText(status) }],
isError: false,
};
}
case 'firecrawl_search': {View on GitHub (pinned to 75dd419e61)
Solutions
- Pass the crawl job ID as `{ id: '<crawl-id>' }` exactly as returned by firecrawl_crawl.
- Fix wrong key names to exactly `id`.
- Persist the crawl job ID from the crawl response so it can be supplied to status checks.
Example fix
// before
firecrawl_check_crawl_status({ 'crawlId': job.id })
// after
firecrawl_check_crawl_status({ 'id': job.id }) Defensive patterns
Strategy: type-guard
Validate before calling
if (!args || typeof (args as any).id !== 'string') {
throw new TypeError('firecrawl_check_crawl_status requires { id: string }');
} Type guard
function isStatusCheckOptions(a: unknown): a is { id: string } {
return typeof a === 'object' && a !== null && 'id' in a && typeof (a as { id: unknown }).id === 'string';
} Try / catch
try {
await callTool({ name: 'firecrawl_check_crawl_status', arguments: { id: crawlJobId } });
} catch (e) {
if ((e as Error).message === 'Invalid arguments for firecrawl_check_crawl_status') {
// resend with { id } taken from the stored crawl job id
}
} Prevention
- Store the crawl job ID returned by firecrawl_crawl and reuse it verbatim.
- Use the exact key `id`, not crawlId/jobId.
- Have the LLM echo the ID from prior tool output rather than reconstructing it.
When it happens
Trigger: Calling firecrawl_check_crawl_status without `id`, with a non-string id, or with a non-object payload — e.g. `{}` or `{"arguments":{"crawlId":"abc"}}`.
Common situations: The LLM loses track of the crawl job ID returned from firecrawl_crawl and omits it, or places it under a wrong key like `crawlId` or `jobId`.
Related errors
- Invalid arguments for firecrawl_scrape
- Invalid arguments for firecrawl_map
- Invalid arguments for firecrawl_crawl
- No arguments provided
- Invalid arguments for firecrawl_search
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/4267c01b4052d2f8.
Report an issue: GitHub.