remove_site
Delete a website from Bing Webmaster Tools by specifying its URL. Use this tool to manage your site list and ensure your account reflects only active or relevant websites.
Instructions
Remove a site from Bing Webmaster Tools.
Args: site_url: The URL of the site to remove
Raises: BingWebmasterError: If the site cannot be removed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| self | Yes | ||
| site_url | Yes |
Implementation Reference
- Generic handler function creation for all tools including remove_site: applies @mcp.tool() decorator, handles args/kwargs filtering, enters service context, dynamically calls service.sites.remove_site.# Create wrapper function with same signature @mcp.tool() @wraps(original_method) async def wrapper(*args: Any, **kwargs: Any) -> Any: # Filter out any 'self' arguments that might be passed by the MCP client kwargs = {k: v for k, v in kwargs.items() if k != "self"} async with service as s: service_obj = getattr(s, service_attr) # Get the method from the instance method = getattr(service_obj, method_name) # Call the method directly - it's already bound to the instance return await method(*args, **kwargs) # Copy signature and docstring wrapper.__signature__ = new_sig # type: ignore wrapper.__doc__ = original_method.__doc__
- mcp_server_bwt/tools/bing_webmaster.py:88-88 (registration)Direct registration point for the 'remove_site' tool by invoking the wrapper for the sites service's remove_site method.remove_site = wrap_service_method(mcp, service, "sites", "remove_site") # noqa: F841
- mcp_server_bwt/main.py:17-17 (registration)Top-level call to register all Bing Webmaster tools, including the remove_site tool.add_bing_webmaster_tools(mcp, bing_service)
- Mapping of service attributes to their classes; 'sites' maps to SiteManagementService containing the remove_site method.SERVICE_CLASSES = { "sites": site_management.SiteManagementService, "submission": submission.SubmissionService, "traffic": traffic_analysis.TrafficAnalysisService, "crawling": crawling.CrawlingService, "keywords": keyword_analysis.KeywordAnalysisService, "links": link_analysis.LinkAnalysisService, "content": content_management.ContentManagementService, "blocking": content_blocking.ContentBlockingService, "regional": regional_settings.RegionalSettingsService, "urls": url_management.UrlManagementService, }
- Initializes the 'sites' service attribute on BingWebmasterService, providing access to remove_site method.self.sites = site_management.SiteManagementService(self.client)