{"record":{"id":"e0566e4d53ecd59c","repo":"different-ai/openwork","slug":"mcp-provider-tool-error","errorCode":"MCP_PROVIDER_TOOL_ERROR","errorMessage":"Inspect the provider operation result and provider logs using the diagnostic reference.","messagePattern":"Inspect the provider operation result and provider logs using the diagnostic reference\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-api/src/capability-sources/external-mcp-diagnostics.ts","lineNumber":1596,"sourceCode":"          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\",\n            retryable: true,\n            actionOwner: \"provider_admin\",\n            operatorAction: \"Wait for the provider rate limit to reset, then retry with bounded backoff.\",\n          }\n        : {\n            phase: \"PROVIDER_EXECUTION\",\n            category: \"provider_tool_error\",\n            code: \"MCP_PROVIDER_TOOL_ERROR\",\n            retryable: false,\n            actionOwner: \"provider_admin\",\n            operatorAction: \"Inspect the provider operation result and provider logs using the diagnostic reference.\",\n          }\n    const classification: Classification = {\n      ...classificationBase,\n      ...(providerStatus === undefined ? {} : { providerStatus }),\n      ...(providerCode ? { providerCode } : {}),\n      payloadBytes: evidence.payloadBytes,\n      ...(evidence.excerpt ? { providerErrorMessage: evidence.excerpt } : {}),\n    }\n    logProviderToolEvidence({\n      referenceId: this.referenceId,\n      evidence,\n      diagnosticCode: classification.code,\n      ...(providerStatus === undefined ? {} : { providerStatus }),\n      ...(providerCode ? { providerCode } : {}),\n      ...(requestId ? { providerRequestId: requestId } : {}),","sourceCodeStart":1578,"sourceCodeEnd":1614,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-api/src/capability-sources/external-mcp-diagnostics.ts#L1578-L1614","documentation":"This is the fallback tool-execution classification: the provider responded with an error that is not invalid-arguments, not 403, and not 429, so the classifier emits provider_tool_error at phase PROVIDER_EXECUTION, non-retryable, owned by the provider admin. It typically represents a provider-side tool error result (e.g. the MCP tool returned isError or the upstream operation failed inside the provider).","triggerScenarios":"MCP tool call where the provider itself reports the operation failed: the tool returned an error result, the provider's upstream dependency failed, unhandled provider exception (5xx), or malformed provider response that fits no other classification bucket.","commonSituations":"Provider's backend service down or degraded; provider bug triggered by valid input; provider database/dependency outage; provider returning 500 on a specific resource; tool timing out internally and surfacing an error result.","solutions":["Inspect the provider operation result payload for the error detail and correlate with provider-side logs using the diagnostic reference.","Check the provider's status page/health endpoints for an ongoing incident.","Reproduce with a minimal tool call to determine if it's input-specific or a provider fault.","Report to the provider admin with the diagnostic reference; retry only after the provider confirms the fault is fixed."],"exampleFix":"// before: blind retry on any tool failure\ntry { return await callTool(name, args); } catch { return callTool(name, args); }\n// after: log diagnostic and surface instead of blind retry\ncatch (e) { logDiagnostic('MCP_PROVIDER_TOOL_ERROR', e); throw e; }","handlingStrategy":"try-catch","validationCode":"const health = await fetch(`${providerBase}/healthz`).then(r => r.status);\nif (health !== 200) throw new Error(`Provider unhealthy (status ${health}); skipping tool call`);","typeGuard":"function isProviderToolError(d: { code: string }): boolean {\n  return d.code === 'MCP_PROVIDER_TOOL_ERROR';\n}","tryCatchPattern":"try { return await callTool(name, args); } catch (e) {\n  if (isProviderToolError(e.diagnostic)) { logWithDiagnosticReference(e); notifyProviderAdmin(e.diagnostic); throw e; }\n  throw e;\n}","preventionTips":["Log the full diagnostic reference with every tool failure for provider-side correlation","Check provider status/health endpoints before bulk operations","Reproduce failures with minimal calls to separate provider faults from input issues","Escalate to the provider admin rather than blind-retrying non-retryable classifications"],"tags":["mcp","tool-call","provider-error","diagnostics"],"backgroundTag":"provider-tool-error","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}