{"record":{"id":"6df4a7b13d723f86","repo":"mastra-ai/mastra","slug":"response-error","errorCode":null,"errorMessage":"${response.error}","messagePattern":"\\$\\{response\\.error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts","lineNumber":698,"sourceCode":"        } catch (error) {\n          const errorMessage = error instanceof Error ? error.message : String(error);\n          return {\n            content: [{ type: 'text', text: trimResponseText(errorMessage) }],\n            isError: true,\n          };\n        }\n      }\n\n      case 'firecrawl_map': {\n        if (!isMapOptions(args)) {\n          throw new Error('Invalid arguments for firecrawl_map');\n        }\n        const { url, ...options } = args;\n        const response = await client.mapUrl(url, {\n          ...options,\n        });\n        if ('error' in response) {\n          throw new Error(response.error);\n        }\n        if (!response.links) {\n          throw new Error('No links received from Firecrawl API');\n        }\n        return {\n          content: [{ type: 'text', text: trimResponseText(response.links.join('\\n')) }],\n          isError: false,\n        };\n      }\n\n      case 'firecrawl_crawl': {\n        if (!isCrawlOptions(args)) {\n          throw new Error('Invalid arguments for firecrawl_crawl');\n        }\n        const { url, ...options } = args;\n        const response = await withRetry(async () => client.asyncCrawlUrl(url, { ...options }), 'crawl operation');\n\n        if (!response.success) {","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts#L680-L716","documentation":"When `client.mapUrl` returns a payload containing an `error` field, the executor throws it directly. This propagates Firecrawl API-side failures (auth, invalid URL, server error) for the map operation.","triggerScenarios":"mapUrl responding with `{ error: ... }` — invalid API key, malformed/unroutable site URL, Firecrawl 4xx/5xx for the mapping job.","commonSituations":"Expired FIRECRAWL_API_KEY, mapping an intranet/localhost URL the service cannot reach, transient Firecrawl outages.","solutions":["Inspect the propagated `response.error` and fix the named cause (usually auth or URL).","Confirm the target site is publicly reachable by the Firecrawl service.","Check API key validity and account status before retrying."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!process.env.FIRECRAWL_API_KEY) throw new Error('FIRECRAWL_API_KEY missing');\nconst u = new URL(args.url); // throws on malformed URL\nif (u.hostname === 'localhost' || u.hostname.startsWith('192.168.')) throw new Error('URL not publicly reachable');","typeGuard":"function isMapError(r: unknown): r is { error: string } {\n  return typeof r === 'object' && r !== null && 'error' in r && typeof (r as any).error === 'string';\n}","tryCatchPattern":"try {\n  const res = await client.mapUrl(url, options);\n  if ('error' in res) throw new Error(res.error);\n} catch (e) {\n  if (/429|rate limit/i.test((e as Error).message)) await backoffAndRetry(url);\n  else logAndFail((e as Error).message);\n}","preventionTips":["Only map publicly reachable URLs the Firecrawl service can access.","Rotate/verify API keys on a schedule.","Apply exponential backoff on 429s for map calls too (fixture only retries crawls)."],"tags":["api-response","network","auth"],"backgroundTag":"api-request-failed","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}