{"record":{"id":"4220624247ed7ff4","repo":"mastra-ai/mastra","slug":"no-arguments-provided","errorCode":null,"errorMessage":"No arguments provided","messagePattern":"No arguments provided","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts","lineNumber":619,"sourceCode":"\n      await delay(delayMs);\n      return withRetry(operation, context, attempt + 1);\n    }\n\n    throw error;\n  }\n}\n// --- End added back helper functions ---\n\n// Define the tool execution logic creator\nconst createExecuteFunction = (originalName: string) => async (args: any) => {\n  const client = new FirecrawlApp({ apiKey: 'FIXTURE_API_KEY_PLACEHOLDER' });\n  const startTime = Date.now();\n  try {\n    safeLog('info', `[${new Date().toISOString()}] Received request for tool: ${originalName}`);\n\n    if (!args) {\n      throw new Error('No arguments provided');\n    }\n\n    switch (originalName) {\n      case 'firecrawl_scrape': {\n        if (!isScrapeOptions(args)) {\n          throw new Error('Invalid arguments for firecrawl_scrape');\n        }\n        const { url, ...options } = args;\n        try {\n          const scrapeStartTime = Date.now();\n          safeLog('info', `Starting scrape for URL: ${url} with options: ${JSON.stringify(options)}`);\n\n          const response = await client.scrapeUrl(url, {\n            ...options,\n          });\n\n          safeLog('info', `Scrape completed in ${Date.now() - scrapeStartTime}ms`);\n","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/__fixtures__/fire-crawl-complex-schema.ts#L601-L637","documentation":"The MCP tool executor `createExecuteFunction` throws this when an LLM client invokes a Firecrawl tool with `args` being null/undefined. Since every Firecrawl operation requires at least a `url` (or an `id` for status checks), the server rejects the call up front rather than passing undefined into the request handlers.","triggerScenarios":"Calling any firecrawl_* MCP tool with a null/undefined `arguments` payload — e.g. the client sends `{\"name\":\"firecrawl_scrape\",\"arguments\":null}` or omits the arguments key entirely.","commonSituations":"LLM clients that emit empty tool calls, broken prompt/tool-schema negotiation causing the model to omit arguments, custom MCP clients that forget to serialize the arguments object.","solutions":["Ensure the MCP client always sends a non-null `arguments` object, even for tools with only optional parameters.","Wrap the tool call site so arguments default to `{}` before invoking the tool.","Re-validate the client's tool-schema negotiation so the model knows required parameters exist."],"exampleFix":"// before\nawait client.callTool({ name: 'firecrawl_scrape' });\n// after\nawait client.callTool({ name: 'firecrawl_scrape', arguments: { url: 'https://example.com' } });","handlingStrategy":"validation","validationCode":"// run before calling the tool\nif (args === null || args === undefined || typeof args !== 'object') {\n  throw new TypeError('firecrawl tool call requires an arguments object');\n}\nargs = args ?? {};","typeGuard":"function hasArgs(a: unknown): a is Record<string, unknown> {\n  return typeof a === 'object' && a !== null;\n}","tryCatchPattern":"try {\n  const result = await callTool({ name, arguments: args ?? {} });\n} catch (e) {\n  if ((e as Error).message === 'No arguments provided') {\n    // retry with a default empty arguments object or correct payload\n  }\n}","preventionTips":["Always send an explicit arguments object even when only optional params exist.","Enable tool-schema validation in the MCP client before dispatching calls.","Log outgoing tool-call payloads during development to catch null arguments early."],"tags":["mcp","validation","missing-arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}