You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validate credential reference shape in manage_auth_connections create
Cursor Bugbot caught that we were sending invalid credential payloads
when only credential_path or credential_auto was provided without
credential_provider. Add upfront validation so the agent gets a clear
MCP-level error instead of a generic API rejection.
Copy file name to clipboardExpand all lines: src/app/[transport]/route.ts
+39-14Lines changed: 39 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -2304,24 +2304,49 @@ Based on your issue "${issue_description}", start with:
2304
2304
],
2305
2305
};
2306
2306
}
2307
+
consthasName=!!params.credential_name;
2308
+
consthasProvider=!!params.credential_provider;
2309
+
consthasPath=!!params.credential_path;
2310
+
consthasAuto=params.credential_auto!==undefined;
2311
+
if(hasName&&(hasProvider||hasPath||hasAuto)){
2312
+
return{
2313
+
content: [
2314
+
{
2315
+
type: "text",
2316
+
text: "Error: credential_name cannot be combined with credential_provider, credential_path, or credential_auto. Use one of: { credential_name } for Kernel credentials, { credential_provider, credential_path } for an external provider item, or { credential_provider, credential_auto: true } for provider domain lookup.",
2317
+
},
2318
+
],
2319
+
};
2320
+
}
2321
+
if((hasPath||hasAuto)&&!hasProvider){
2322
+
return{
2323
+
content: [
2324
+
{
2325
+
type: "text",
2326
+
text: "Error: credential_path and credential_auto require credential_provider.",
2327
+
},
2328
+
],
2329
+
};
2330
+
}
2331
+
if(hasProvider&&!hasPath&&!hasAuto){
2332
+
return{
2333
+
content: [
2334
+
{
2335
+
type: "text",
2336
+
text: "Error: credential_provider requires either credential_path or credential_auto: true.",
0 commit comments