@@ -37,14 +37,14 @@ async def setup(self):
3737 self .scan_watch_task = self .create_task (self .start_scans_loop ())
3838 return True , ""
3939
40- @api_endpoint ("/get/{id}" , methods = ["GET" ], summary = "Get a single scan by its name or ID" )
40+ @api_endpoint ("/get/{id}" , methods = ["GET" ], summary = "Get a single scan by its name or ID" , mcp = True )
4141 async def get_scan (self , id : str ) -> Scan :
4242 scan = await self .collection .find_one ({"$or" : [{"id" : str (id )}, {"name" : str (id )}]})
4343 if scan is None :
4444 raise self .BBOTServerNotFoundError ("Scan not found" )
4545 return Scan (** scan )
4646
47- @api_endpoint ("/start" , methods = ["POST" ], summary = "Create a new scan" )
47+ @api_endpoint ("/start" , methods = ["POST" ], summary = "Create a new scan" , mcp = True )
4848 async def start_scan (
4949 self ,
5050 target_id : str ,
@@ -85,20 +85,20 @@ async def start_scan(
8585 )
8686 return scan
8787
88- @api_endpoint ("/list" , methods = ["GET" ], type = "http_stream" , response_model = Scan , summary = "Get all scans" )
88+ @api_endpoint ("/list" , methods = ["GET" ], type = "http_stream" , response_model = Scan , summary = "Get all scans" , mcp = True )
8989 async def get_scans (self ):
9090 async for scan in self .collection .find ():
9191 yield Scan (** scan )
9292
93- @api_endpoint ("/query" , methods = ["POST" ], type = "http_stream" , response_model = dict , summary = "Query scans" )
93+ @api_endpoint ("/query" , methods = ["POST" ], type = "http_stream" , response_model = dict , summary = "Query scans" , mcp = True )
9494 async def query_scans (self , query : ScanQuery | None = None ):
9595 """
9696 Advanced querying of scans. Choose your own filters and fields.
9797 """
9898 async for scan in query .mongo_iter (self ):
9999 yield scan
100100
101- @api_endpoint ("/count" , methods = ["POST" ], summary = "Count scans" )
101+ @api_endpoint ("/count" , methods = ["POST" ], summary = "Count scans" , mcp = True )
102102 async def count_scans (self , query : ScanQuery | None = None ) -> int :
103103 """
104104 Same as query_scans, except only returns the count.
@@ -124,13 +124,13 @@ async def get_available_scan_name(self) -> str:
124124 valid_name = True
125125 return name
126126
127- @api_endpoint ("/queued" , methods = ["GET" ], summary = "List queued scans" )
127+ @api_endpoint ("/queued" , methods = ["GET" ], summary = "List queued scans" , mcp = True )
128128 async def get_queued_scans (self ) -> list [Scan ]:
129129 # we sort by `created` ascending to get the oldest queued scans first
130130 cursor = self .collection .find ({"status" : "QUEUED" }, sort = [("created" , ASCENDING )])
131131 return [Scan (** run ) for run in await cursor .to_list (length = None )]
132132
133- @api_endpoint ("/cancel/{id}" , methods = ["POST" ], summary = "Cancel a scan by its name or ID" )
133+ @api_endpoint ("/cancel/{id}" , methods = ["POST" ], summary = "Cancel a scan by its name or ID" , mcp = True )
134134 async def cancel_scan (self , id : str , force : bool = False ):
135135 # get the scan
136136 scan = await self .get_scan (id )
0 commit comments