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
Copy file name to clipboardExpand all lines: aws/aws-mcp-cli-commands/src/main/java/software/amazon/smithy/java/aws/mcp/cli/commands/AddAwsServiceBundle.java
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -35,22 +35,28 @@ public class AddAwsServiceBundle extends AbstractAddBundle {
35
35
protectedSet<String> blockedApis;
36
36
37
37
@Option(names = "--read-only-apis",
38
-
description = "Include read only APIs in the MCP server",
39
-
defaultValue = "true")
40
-
protectedbooleanreadOnlyApis;
38
+
description = "Include read only APIs in the MCP server")
39
+
protectedBooleanreadOnlyApis;
41
40
42
41
@Override
43
42
protectedCliBundlegetNewToolConfig() {
44
43
varbundleBuilder = AwsServiceBundler.builder()
45
44
.serviceName(awsServiceName);
46
-
if (readOnlyApis) {
47
-
// Include read-only apis unless disabled
48
-
bundleBuilder.readOnlyOperations();
49
-
}
50
45
if (allowedApis != null) {
51
-
// User explicitly specified allowed APIs - use only those
46
+
// User explicitly specified allowed APIs
52
47
bundleBuilder.exposedOperations(allowedApis);
48
+
// If readOnlyApis is also requested, include those as well
49
+
if (Boolean.TRUE.equals(readOnlyApis)) {
50
+
bundleBuilder.readOnlyOperations();
51
+
}
52
+
} elseif (Boolean.FALSE.equals(readOnlyApis)) {
53
+
//If nothing is specified then default to only readOnlyOperations.
54
+
bundleBuilder.readOnlyOperations();
55
+
} else {
56
+
thrownewIllegalArgumentException("You have turned off readOnlyApis and also not specified any " +
57
+
"allowedApis so there are no operations to create a bundle for.");
0 commit comments