@@ -1081,6 +1081,94 @@ public void TestConfigureDescriptionForMcpSettings(string descriptionValue)
10811081 Assert . AreEqual ( descriptionValue , runtimeConfig . Runtime . Mcp . Description ) ;
10821082 }
10831083
1084+ /// <summary>
1085+ /// Tests that running "dab configure --runtime.mcp.dml-tools.{tool} {value}" updates
1086+ /// the individual DML tool boolean in the runtime config. Each tool is a direct boolean
1087+ /// in the schema (e.g., "describe-entities": true), NOT a nested object with .enabled.
1088+ /// </summary>
1089+ [ DataTestMethod ]
1090+ [ DataRow ( true , DisplayName = "Enable individual DML tool: describe-entities" ) ]
1091+ [ DataRow ( false , DisplayName = "Disable individual DML tool: describe-entities" ) ]
1092+ public void TestConfigureIndividualDmlToolForMcpSettings ( bool updatedValue )
1093+ {
1094+ // Arrange
1095+ SetupFileSystemWithInitialConfig ( INITIAL_CONFIG ) ;
1096+
1097+ // Act: Set describe-entities via the corrected option name (no .enabled suffix)
1098+ ConfigureOptions options = new (
1099+ runtimeMcpDmlToolsDescribeEntitiesEnabled : updatedValue ,
1100+ config : TEST_RUNTIME_CONFIG_FILE
1101+ ) ;
1102+ bool isSuccess = TryConfigureSettings ( options , _runtimeConfigLoader ! , _fileSystem ! ) ;
1103+
1104+ // Assert
1105+ Assert . IsTrue ( isSuccess ) ;
1106+ string updatedConfig = _fileSystem ! . File . ReadAllText ( TEST_RUNTIME_CONFIG_FILE ) ;
1107+ Assert . IsTrue ( RuntimeConfigLoader . TryParseConfig ( updatedConfig , out RuntimeConfig ? runtimeConfig ) ) ;
1108+ Assert . IsNotNull ( runtimeConfig . Runtime ? . Mcp ? . DmlTools ) ;
1109+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . DescribeEntities ) ;
1110+ }
1111+
1112+ /// <summary>
1113+ /// Tests that running "dab configure --runtime.mcp.dml-tools.enabled {value}" sets all
1114+ /// DML tools at once via the bulk toggle.
1115+ /// </summary>
1116+ [ DataTestMethod ]
1117+ [ DataRow ( true , DisplayName = "Enable all DML tools at once" ) ]
1118+ [ DataRow ( false , DisplayName = "Disable all DML tools at once" ) ]
1119+ public void TestConfigureAllDmlToolsForMcpSettings ( bool updatedValue )
1120+ {
1121+ // Arrange
1122+ SetupFileSystemWithInitialConfig ( INITIAL_CONFIG ) ;
1123+
1124+ // Act: Set all tools via the bulk enabled toggle
1125+ ConfigureOptions options = new (
1126+ runtimeMcpDmlToolsEnabled : updatedValue ,
1127+ config : TEST_RUNTIME_CONFIG_FILE
1128+ ) ;
1129+ bool isSuccess = TryConfigureSettings ( options , _runtimeConfigLoader ! , _fileSystem ! ) ;
1130+
1131+ // Assert
1132+ Assert . IsTrue ( isSuccess ) ;
1133+ string updatedConfig = _fileSystem ! . File . ReadAllText ( TEST_RUNTIME_CONFIG_FILE ) ;
1134+ Assert . IsTrue ( RuntimeConfigLoader . TryParseConfig ( updatedConfig , out RuntimeConfig ? runtimeConfig ) ) ;
1135+ Assert . IsNotNull ( runtimeConfig . Runtime ? . Mcp ? . DmlTools ) ;
1136+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . DescribeEntities ) ;
1137+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . CreateRecord ) ;
1138+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . ReadRecords ) ;
1139+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . UpdateRecord ) ;
1140+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . DeleteRecord ) ;
1141+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . ExecuteEntity ) ;
1142+ Assert . AreEqual ( updatedValue , runtimeConfig . Runtime . Mcp . DmlTools . AggregateRecords ) ;
1143+ }
1144+
1145+ /// <summary>
1146+ /// Tests that running "dab configure" with multiple individual DML tool options
1147+ /// correctly updates each tool independently.
1148+ /// </summary>
1149+ [ TestMethod ]
1150+ public void TestConfigureMultipleIndividualDmlToolsForMcpSettings ( )
1151+ {
1152+ // Arrange
1153+ SetupFileSystemWithInitialConfig ( INITIAL_CONFIG ) ;
1154+
1155+ // Act: Enable describe-entities, disable create-record
1156+ ConfigureOptions options = new (
1157+ runtimeMcpDmlToolsDescribeEntitiesEnabled : true ,
1158+ runtimeMcpDmlToolsCreateRecordEnabled : false ,
1159+ config : TEST_RUNTIME_CONFIG_FILE
1160+ ) ;
1161+ bool isSuccess = TryConfigureSettings ( options , _runtimeConfigLoader ! , _fileSystem ! ) ;
1162+
1163+ // Assert
1164+ Assert . IsTrue ( isSuccess ) ;
1165+ string updatedConfig = _fileSystem ! . File . ReadAllText ( TEST_RUNTIME_CONFIG_FILE ) ;
1166+ Assert . IsTrue ( RuntimeConfigLoader . TryParseConfig ( updatedConfig , out RuntimeConfig ? runtimeConfig ) ) ;
1167+ Assert . IsNotNull ( runtimeConfig . Runtime ? . Mcp ? . DmlTools ) ;
1168+ Assert . AreEqual ( true , runtimeConfig . Runtime . Mcp . DmlTools . DescribeEntities ) ;
1169+ Assert . AreEqual ( false , runtimeConfig . Runtime . Mcp . DmlTools . CreateRecord ) ;
1170+ }
1171+
10841172 /// <summary>
10851173 /// Validates that `dab configure --show-effective-permissions` correctly displays
10861174 /// effective permissions without modifying the config file.
0 commit comments