{"record":{"id":"23e3b9c6b85fba40","repo":"different-ai/openwork","slug":"failed-to-add-native-provider-connection-respon","errorCode":null,"errorMessage":"Failed to add native provider connection (${response.status}).","messagePattern":"Failed to add native provider connection \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx","lineNumber":764,"sourceCode":"export function useCreateNativeProviderConnection() {\n  const queryClient = useQueryClient();\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (input: CreateNativeProviderConnectionInput): Promise<CreatedMcpConnection> => {\n      let created: CreatedMcpConnection | null = null;\n      await runReauthableAction(\"create-mcp-connection\", async () => {\n        const { response, payload } = await requestJson(\n          \"/v1/mcp-connections\",\n          {\n            method: \"POST\",\n            headers: getOrgScopeHeaders(requireOrgId(orgId)),\n            body: JSON.stringify({ kind: \"native_provider\", ...input }),\n          },\n          20000,\n        );\n        if (!response.ok) {\n          throw getRequestError(payload, response, `Failed to add native provider connection (${response.status}).`);\n        }\n        created = payload as CreatedMcpConnection;\n      });\n      if (!created) throw new Error(\"Create native provider connection response was incomplete.\");\n      return created;\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: mcpConnectionQueryKeys.all });\n    },\n  });\n}\n\nexport function useUpdateMcpConnection() {\n  const queryClient = useQueryClient();\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (input: UpdateMcpConnectionInput): Promise<UpdatedMcpConnection> => {","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx#L746-L782","documentation":"Error \"Failed to add native provider connection (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx:764 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}