@@ -13,9 +13,8 @@ export const getRunDetailsTool = {
1313 ctx . logger ?. log ( "calling get_run_details" , { input } ) ;
1414
1515 if ( ! ctx . isEnvironmentAllowed ( input . environment ) ) {
16- const allowedEnvs = ctx . options . envOnly ?. join ( ", " ) || "dev" ;
1716 return respondWithError (
18- `This MCP server is restricted to the following environments : ${ allowedEnvs } . You tried to access the ${ input . environment } environment. `
17+ `Cannot access ${ input . environment } environment. This MCP server is restricted to: ${ ctx . getAllowedEnvironments ( ) } `
1918 ) ;
2019 }
2120
@@ -71,9 +70,8 @@ export const waitForRunToCompleteTool = {
7170 ctx . logger ?. log ( "calling wait_for_run_to_complete" , { input } ) ;
7271
7372 if ( ! ctx . isEnvironmentAllowed ( input . environment ) ) {
74- const allowedEnvs = ctx . options . envOnly ?. join ( ", " ) || "dev" ;
7573 return respondWithError (
76- `This MCP server is restricted to the following environments : ${ allowedEnvs } . You tried to access the ${ input . environment } environment. `
74+ `Cannot access ${ input . environment } environment. This MCP server is restricted to: ${ ctx . getAllowedEnvironments ( ) } `
7775 ) ;
7876 }
7977
@@ -125,9 +123,8 @@ export const cancelRunTool = {
125123 ctx . logger ?. log ( "calling cancel_run" , { input } ) ;
126124
127125 if ( ! ctx . isEnvironmentAllowed ( input . environment ) ) {
128- const allowedEnvs = ctx . options . envOnly ?. join ( ", " ) || "dev" ;
129126 return respondWithError (
130- `This MCP server is restricted to the following environments : ${ allowedEnvs } . You tried to access the ${ input . environment } environment. `
127+ `Cannot access ${ input . environment } environment. This MCP server is restricted to: ${ ctx . getAllowedEnvironments ( ) } `
131128 ) ;
132129 }
133130
@@ -166,9 +163,8 @@ export const listRunsTool = {
166163 ctx . logger ?. log ( "calling list_runs" , { input } ) ;
167164
168165 if ( ! ctx . isEnvironmentAllowed ( input . environment ) ) {
169- const allowedEnvs = ctx . options . envOnly ?. join ( ", " ) || "dev" ;
170166 return respondWithError (
171- `This MCP server is restricted to the following environments : ${ allowedEnvs } . You tried to access the ${ input . environment } environment. `
167+ `Cannot access ${ input . environment } environment. This MCP server is restricted to: ${ ctx . getAllowedEnvironments ( ) } `
172168 ) ;
173169 }
174170
0 commit comments