add_connected_page
Submit a page linking to your website to Bing Webmaster Tools for indexing and backlink tracking.
Instructions
Add a page which has a link to your website.
Args: site_url: The URL of your site master_url: The URL of the page to be connected
Raises: BingWebmasterError: If page cannot be connected
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| self | Yes | ||
| site_url | Yes | ||
| master_url | Yes |
Implementation Reference
- Handler implementation for the 'add_connected_page' tool. This dynamic wrapper function is decorated with @mcp.tool(), copies the original method's signature and docstring, and executes the underlying LinkAnalysisService.add_connected_page method via the service context manager.@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:179-181 (registration)Registers the 'add_connected_page' tool with the MCP server by invoking the wrapper on the 'links' service method.add_connected_page = wrap_service_method( # noqa: F841 mcp, service, "links", "add_connected_page" )
- mcp_server_bwt/main.py:14-17 (registration)Main server setup: creates BingWebmasterService instance and calls the function to register all tools, including 'add_connected_page'.bing_service = BingWebmasterService(api_key=api_key) # Add the tools to the MCP server add_bing_webmaster_tools(mcp, bing_service)
- Mapping of service names (e.g., 'links') to classes, used to fetch original method signatures for schema preservation.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 'links' LinkAnalysisService instance (providing add_connected_page method) within the BingWebmasterService context manager.self.links = link_analysis.LinkAnalysisService(self.client)