@@ -235,10 +235,12 @@ async def get_database(
235235
236236async def list_tables ( # Renamed from listTable to follow convention
237237 database_id : str = Field (description = "DMS databaseId" ),
238- search_name : str = Field (description = "Search keyword for table names. % can be used as a wildcard " ),
238+ search_name : Optional [ str ] = Field (description = "Optional: Search keyword for table names" ),
239239 page_number : int = Field (default = 1 , description = "Pagination page number" ),
240240 page_size : int = Field (default = 200 , description = "Results per page (max 200)" )
241241) -> Dict [str , Any ]:
242+ if not search_name :
243+ search_name = "%"
242244 client = create_client ()
243245 req = dms_enterprise_20181101_models .ListTablesRequest (database_id = database_id , search_name = search_name ,
244246 page_number = page_number , page_size = page_size ,
@@ -462,11 +464,13 @@ def _register_configured_db_toolset(self):
462464 description = "Lists tables in the database. Search by name is supported." ,
463465 annotations = {"title" : "List Tables (Pre-configured DB)" , "readOnlyHint" : True })
464466 async def list_tables_configured (
465- search_name : str = Field (
466- description = "A non-empty string used as the search keyword to match table names." ),
467+ search_name : Optional [ str ] = Field (
468+ description = "Optional: A string used as the search keyword to match table names." ),
467469 page_number : int = Field (description = "Pagination page number" , default = 1 ),
468470 page_size : int = Field (description = "Number of results per page" , default = 200 )
469471 ) -> Dict [str , Any ]:
472+ if not search_name :
473+ search_name = "%"
470474 return await list_tables (database_id = self .default_database_id , search_name = search_name ,
471475 page_number = page_number , page_size = page_size )
472476
0 commit comments