continue_batch
Retrieve the next batch of SQL injection scan results from a previously started batch. Use this after receiving 'has_more': true to continue scanning remaining URLs.
Instructions
Continue scanning remaining URLs from a previous batch. Use this when scan_urls_batch returns has_more=True.
Args: batch_id: Batch ID from a previous scan_urls_batch call
Returns: Next batch of scan results
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| batch_id | Yes |
Implementation Reference
- src/sqli_mcp/server.py:664-713 (handler)The continue_batch async function that handles continuing a batch scan. It retrieves the pending scan state from the pending_scans dict by batch_id, builds the remaining URLs, calls scan_urls_batch again with the stored parameters, and cleans up when no more URLs remain.
async def continue_batch(batch_id: str) -> dict: """ Continue scanning remaining URLs from a previous batch. Use this when scan_urls_batch returns has_more=True. Args: batch_id: Batch ID from a previous scan_urls_batch call Returns: Next batch of scan results """ if batch_id not in pending_scans: return {"error": f"No pending scans for batch {batch_id}. Batch may be complete or expired."} pending = pending_scans[batch_id] remaining = pending["remaining_urls"] if not remaining: del pending_scans[batch_id] return {"message": "All URLs in this batch have been scanned", "batch_id": batch_id} # Build URL string for the next batch urls_str = "\n".join(remaining) # Scan next batch result = await scan_urls_batch( urls=urls_str, method=pending["method"], injection_types=pending["injection_types"], database_types=pending["database_types"], headers=pending["headers"], cookies=pending["cookies"], bearer_token=pending["bearer_token"], proxy_url=pending["proxy_url"], verify_ssl=pending["verify_ssl"], waf_bypass=pending["waf_bypass"], concurrency=pending["concurrency"], timeout=pending["timeout"], quick_mode=pending["quick_mode"], max_urls_per_batch=pending["max_urls_per_batch"] ) # Update the original batch_id reference result["original_batch_id"] = batch_id # Clean up if complete if not result.get("has_more", False) and batch_id in pending_scans: del pending_scans[batch_id] return result - src/sqli_mcp/server.py:663-664 (registration)The @mcp.tool() decorator that registers continue_batch as an MCP tool on line 663, just before the function definition.
@mcp.tool() async def continue_batch(batch_id: str) -> dict: - src/sqli_mcp/server.py:485-485 (helper)The pending_scans global dict that stores pending scan state (remaining URLs and parameters) for continuation by continue_batch.
pending_scans: dict[str, dict] = {} - src/sqli_mcp/server.py:580-597 (helper)The code in scan_urls_batch that populates pending_scans with the remaining URLs and all parameters so continue_batch can pick them up later.
if remaining_urls: pending_scans[batch_id] = { "remaining_urls": remaining_urls, "method": method, "injection_types": injection_types, "database_types": database_types, "headers": headers, "cookies": cookies, "bearer_token": bearer_token, "proxy_url": proxy_url, "verify_ssl": verify_ssl, "waf_bypass": waf_bypass, "concurrency": concurrency, "timeout": timeout, "quick_mode": quick_mode, "max_urls_per_batch": max_urls_per_batch, "all_results": [] }