add_site
Add a new website to Bing Webmaster Tools for indexing and management. Submit site URLs to monitor performance and access webmaster features.
Instructions
Add a new site to Bing Webmaster Tools.
Args: site_url: The URL of the site to add
Raises: BingWebmasterError: If the site cannot be added
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| self | Yes | ||
| site_url | Yes |
Implementation Reference
- Dynamic handler implementation for the 'add_site' MCP tool. This wrapper function is decorated with @mcp.tool(), preserves the original method's signature and docstring, and executes the underlying SiteManagementService.add_site method via the BingWebmasterService instance.@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__ return wrapper
- mcp_server_bwt/tools/bing_webmaster.py:86-86 (registration)Specific registration of the 'add_site' tool by invoking wrap_service_method, which creates the handler and registers it with the MCP server.add_site = wrap_service_method(mcp, service, "sites", "add_site") # noqa: F841
- mcp_server_bwt/main.py:17-17 (registration)Top-level registration invocation that adds all Bing Webmaster Tools, including 'add_site', to the MCP server.add_bing_webmaster_tools(mcp, bing_service)
- Initialization of the 'sites' service attribute (SiteManagementService instance) used by the 'add_site' handler.self.sites = site_management.SiteManagementService(self.client)
- Mapping used by wrap_service_method to retrieve the SiteManagementService class for signature and docstring preservation."sites": site_management.SiteManagementService,