{"record":{"id":"640b16192908fb30","repo":"different-ai/openwork","slug":"mcp-provider-invalid-params","errorCode":"MCP_PROVIDER_INVALID_PARAMS","errorMessage":"Correct the tool arguments using the latest advertised input schema; do not retry the same arguments unchanged.","messagePattern":"Correct the tool arguments using the latest advertised input schema; do not retry the same arguments unchanged\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-api/src/capability-sources/external-mcp-diagnostics.ts","lineNumber":1570,"sourceCode":"    const evidence = providerToolContentEvidence(result)\n    const providerStatus = structuredProviderStatus ?? evidence.providerStatus\n    const providerCode = evidence.providerCode\n    const requestId = safeProviderRequestId(structuredContent?.requestId) ?? evidence.providerRequestId\n    if (requestId) this.providerRequestId = requestId\n\n    const providerInvalidArguments = [\n      \"invalid_arguments\",\n      \"invalid_params\",\n      \"validation_error\",\n    ].includes(providerCategory ?? \"\") || isProviderInputValidationExcerpt(evidence.excerpt)\n    const providerPolicyDenied = structuredProviderStatus === 403\n      ? providerCategory === \"provider_policy\"\n      : evidence.providerStatus === 403\n    const classificationBase: Classification = providerInvalidArguments\n      ? {\n          phase: \"MCP_TOOL_EXECUTION\",\n          category: \"mcp_tool_input_invalid\",\n          code: \"MCP_PROVIDER_INVALID_PARAMS\",\n          retryable: false,\n          actionOwner: \"openwork\",\n          operatorAction: \"Correct the tool arguments using the latest advertised input schema; do not retry the same arguments unchanged.\",\n        }\n      : providerPolicyDenied\n      ? {\n          phase: \"PROVIDER_AUTHORIZATION\",\n          category: \"provider_policy_denied\",\n          code: \"MCP_PROVIDER_HTTP_403\",\n          retryable: false,\n          actionOwner: \"provider_admin\",\n          operatorAction: \"Grant the provider role, ACL, or application permission required for this operation.\",\n        }\n      : providerStatus === 429\n        ? {\n            phase: \"PROVIDER_EXECUTION\",\n            category: \"provider_throttled\",\n            code: \"MCP_PROVIDER_HTTP_429\",","sourceCodeStart":1552,"sourceCodeEnd":1588,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-api/src/capability-sources/external-mcp-diagnostics.ts#L1552-L1588","documentation":"This diagnostic code classifies a tool call failure where the provider rejected the arguments: the response evidence (providerCategory === 'provider_policy' excluded, providerStatus 403 excluded) maps to providerInvalidArguments, so the classifier emits mcp_tool_input_invalid at phase MCP_TOOL_EXECUTION. It means the tool executed but the input did not validate against the tool's advertised input schema. It is non-retryable with unchanged arguments and owned by the OpenWork side (the caller must fix the arguments).","triggerScenarios":"Calling an MCP tool with arguments that fail the provider's input validation: wrong types, missing required fields, unknown fields, values outside allowed ranges/enums; arguments generated from a stale or cached tool schema after the provider updated the tool.","commonSituations":"Provider updated a tool's input schema but the client cached the old tools/list result; LLM-generated arguments hallucinating parameter names; passing strings where numbers are required; sending deprecated parameters removed in a newer tool version.","solutions":["Re-fetch the tool's latest advertised input schema (tools/list) and regenerate/fix the arguments against it.","Validate the arguments against the schema locally before the next call; do not retry the identical arguments unchanged.","If a cached tool definition is stale, clear the cache and refresh tool metadata.","Narrow arguments to required fields and correct types per the schema, then re-invoke the tool."],"exampleFix":"// before: stale schema args\nawait callTool('createIssue', { title: t, assignee: 'me' })\n// after: refreshed schema - assigneeId is required string id\nawait callTool('createIssue', { title: t, assigneeId: userId })","handlingStrategy":"validation","validationCode":"import Ajv from 'ajv';\nconst validate = new Ajv().compile(tool.inputSchema);\nif (!validate(args)) throw new Error(`Invalid tool args: ${JSON.stringify(validate.errors)}`);","typeGuard":"function isProviderInvalidParams(d: { code: string }): boolean {\n  return d.code === 'MCP_PROVIDER_INVALID_PARAMS';\n}","tryCatchPattern":"try { return await callTool(name, args); } catch (e) {\n  if (isProviderInvalidParams(e.diagnostic)) { const schema = await refreshToolSchema(name); throw new SchemaMismatchError(name, schema, args); }\n  throw e;\n}","preventionTips":["Refresh tools/list after provider deploys; never cache tool schemas indefinitely","Validate arguments against the advertised JSON Schema before every call","Constrain LLM tool-argument generation to the schema (structured output / function-calling)","Never retry a failed call with byte-identical arguments"],"tags":["mcp","tool-call","input-validation","schema"],"backgroundTag":"invalid-tool-arguments","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}