Skip to content

Commit 5f87644

Browse files
author
andypalmi
committed
refactor(mcp): pass inject response through for instance-config 404 handling
1 parent 802da78 commit 5f87644

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

forge/ee/lib/mcp/tools/instanceConfig.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ module.exports = [
1515
},
1616
handler: async (args, { inject }) => {
1717
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/ha` })
18-
if (response.statusCode === 404) {
19-
return { error: 'High Availability configuration is not available for this instance. This can mean the instance does not exist or the High Availability feature is not enabled for the team.' }
20-
}
2118
return response
2219
}
2320
},
@@ -35,9 +32,6 @@ module.exports = [
3532
},
3633
handler: async (args, { inject }) => {
3734
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/customHostname` })
38-
if (response.statusCode === 404) {
39-
return { error: 'Custom hostname configuration is not available for this instance. This can mean the instance does not exist or the custom hostname feature is not enabled for the team.' }
40-
}
4135
return response
4236
}
4337
},
@@ -57,9 +51,6 @@ module.exports = [
5751
},
5852
handler: async (args, { inject }) => {
5953
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/customHostname/status` })
60-
if (response.statusCode === 404) {
61-
return { error: 'No custom hostname is configured for this instance, hostname verification is not supported by this platform, or the custom hostname feature is not enabled for the team.' }
62-
}
6354
return response
6455
}
6556
},
@@ -78,9 +69,6 @@ module.exports = [
7869
},
7970
handler: async (args, { inject }) => {
8071
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/protectInstance` })
81-
if (response.statusCode === 404) {
82-
return { error: 'Protected-instance configuration is not available for this instance. This can mean the instance does not exist or the protected-instance feature is not enabled for the team.' }
83-
}
8472
return response
8573
}
8674
},
@@ -116,9 +104,6 @@ module.exports = [
116104
},
117105
handler: async (args, { inject }) => {
118106
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/files/_/${encodeURIComponent(args.path)}` })
119-
if (response.statusCode === 404) {
120-
return { error: 'File storage is not available for this instance. This can mean the instance does not exist, the requested path was not found, or the static file storage feature is not enabled for the team.' }
121-
}
122107
return response
123108
}
124109
},
@@ -137,9 +122,6 @@ module.exports = [
137122
},
138123
handler: async (args, { inject }) => {
139124
const response = await inject({ method: 'GET', url: `/api/v1/projects/${args.instanceId}/httpTokens` })
140-
if (response.statusCode === 404) {
141-
return { error: 'HTTP bearer tokens are not available for this instance. This can mean the instance does not exist or the HTTP bearer tokens feature is not enabled for the team.' }
142-
}
143125
return response
144126
}
145127
},
@@ -158,9 +140,6 @@ module.exports = [
158140
},
159141
handler: async (args, { inject }) => {
160142
const response = await inject({ method: 'GET', url: `/api/v1/devices/${args.deviceId}/httpTokens` })
161-
if (response.statusCode === 404) {
162-
return { error: 'HTTP bearer tokens are not available for this remote instance. This can mean the remote instance does not exist or the HTTP bearer tokens feature is not enabled for the team.' }
163-
}
164143
return response
165144
}
166145
}

0 commit comments

Comments
 (0)