{"record":{"id":"4267c01b4052d2f8","repo":"mastra-ai/mastra","slug":"invalid-arguments-for-firecrawl-check-crawl-status","errorCode":null,"errorMessage":"Invalid arguments for firecrawl_check_crawl_status","messagePattern":"Invalid arguments for firecrawl_check_crawl_status","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts","lineNumber":733,"sourceCode":"\n        if (!response.success) {\n          throw new Error(response.error);\n        }\n\n        return {\n          content: [\n            {\n              type: 'text',\n              text: trimResponseText(`Started crawl for ${url} with job ID: ${response.id}`),\n            },\n          ],\n          isError: false,\n        };\n      }\n\n      case 'firecrawl_check_crawl_status': {\n        if (!isStatusCheckOptions(args)) {\n          throw new Error('Invalid arguments for firecrawl_check_crawl_status');\n        }\n        const response = await client.checkCrawlStatus(args.id);\n        if (!response.success) {\n          throw new Error(response.error);\n        }\n        const status = `Crawl Status:\nStatus: ${response.status}\nProgress: ${response.completed}/${response.total}\nCredits Used: ${response.creditsUsed}\nExpires At: ${response.expiresAt}\n${response.data.length > 0 ? '\\nResults:\\n' + formatResults(response.data) : ''}`;\n        return {\n          content: [{ type: 'text', text: trimResponseText(status) }],\n          isError: false,\n        };\n      }\n\n      case 'firecrawl_search': {","sourceCodeStart":715,"sourceCodeEnd":751,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts#L715-L751","documentation":"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.","triggerScenarios":"Calling firecrawl_check_crawl_status without `id`, with a non-string id, or with a non-object payload — e.g. `{}` or `{\"arguments\":{\"crawlId\":\"abc\"}}`.","commonSituations":"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`.","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."],"exampleFix":"// before\nfirecrawl_check_crawl_status({ 'crawlId': job.id })\n// after\nfirecrawl_check_crawl_status({ 'id': job.id })","handlingStrategy":"type-guard","validationCode":"if (!args || typeof (args as any).id !== 'string') {\n  throw new TypeError('firecrawl_check_crawl_status requires { id: string }');\n}","typeGuard":"function isStatusCheckOptions(a: unknown): a is { id: string } {\n  return typeof a === 'object' && a !== null && 'id' in a && typeof (a as { id: unknown }).id === 'string';\n}","tryCatchPattern":"try {\n  await callTool({ name: 'firecrawl_check_crawl_status', arguments: { id: crawlJobId } });\n} catch (e) {\n  if ((e as Error).message === 'Invalid arguments for firecrawl_check_crawl_status') {\n    // resend with { id } taken from the stored crawl job id\n  }\n}","preventionTips":["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."],"tags":["mcp","validation","type-guard"],"backgroundTag":"invalid-tool-arguments","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}