different-ai/openwork · error

MCP_PROVIDER_INVALID_PARAMS

MCP_PROVIDER_INVALID_PARAMS

Error message

Correct the tool arguments using the latest advertised input schema; do not retry the same arguments unchanged.

What it means

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).

Source

Thrown at ee/apps/den-api/src/capability-sources/external-mcp-diagnostics.ts:1570

    const evidence = providerToolContentEvidence(result)
    const providerStatus = structuredProviderStatus ?? evidence.providerStatus
    const providerCode = evidence.providerCode
    const requestId = safeProviderRequestId(structuredContent?.requestId) ?? evidence.providerRequestId
    if (requestId) this.providerRequestId = requestId

    const providerInvalidArguments = [
      "invalid_arguments",
      "invalid_params",
      "validation_error",
    ].includes(providerCategory ?? "") || isProviderInputValidationExcerpt(evidence.excerpt)
    const providerPolicyDenied = structuredProviderStatus === 403
      ? providerCategory === "provider_policy"
      : evidence.providerStatus === 403
    const classificationBase: Classification = providerInvalidArguments
      ? {
          phase: "MCP_TOOL_EXECUTION",
          category: "mcp_tool_input_invalid",
          code: "MCP_PROVIDER_INVALID_PARAMS",
          retryable: false,
          actionOwner: "openwork",
          operatorAction: "Correct the tool arguments using the latest advertised input schema; do not retry the same arguments unchanged.",
        }
      : providerPolicyDenied
      ? {
          phase: "PROVIDER_AUTHORIZATION",
          category: "provider_policy_denied",
          code: "MCP_PROVIDER_HTTP_403",
          retryable: false,
          actionOwner: "provider_admin",
          operatorAction: "Grant the provider role, ACL, or application permission required for this operation.",
        }
      : providerStatus === 429
        ? {
            phase: "PROVIDER_EXECUTION",
            category: "provider_throttled",
            code: "MCP_PROVIDER_HTTP_429",

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Re-fetch the tool's latest advertised input schema (tools/list) and regenerate/fix the arguments against it.
  2. Validate the arguments against the schema locally before the next call; do not retry the identical arguments unchanged.
  3. If a cached tool definition is stale, clear the cache and refresh tool metadata.
  4. Narrow arguments to required fields and correct types per the schema, then re-invoke the tool.

Example fix

// before: stale schema args
await callTool('createIssue', { title: t, assignee: 'me' })
// after: refreshed schema - assigneeId is required string id
await callTool('createIssue', { title: t, assigneeId: userId })
Defensive patterns

Strategy: validation

Validate before calling

import Ajv from 'ajv';
const validate = new Ajv().compile(tool.inputSchema);
if (!validate(args)) throw new Error(`Invalid tool args: ${JSON.stringify(validate.errors)}`);

Type guard

function isProviderInvalidParams(d: { code: string }): boolean {
  return d.code === 'MCP_PROVIDER_INVALID_PARAMS';
}

Try / catch

try { return await callTool(name, args); } catch (e) {
  if (isProviderInvalidParams(e.diagnostic)) { const schema = await refreshToolSchema(name); throw new SchemaMismatchError(name, schema, args); }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/640b16192908fb30. Report an issue: GitHub.