add_connected_page
Connect a page linking to your website by providing its URL and your site's URL using the MCP server. Ensures proper indexing and visibility in Bing Webmaster Tools.
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 |
|---|---|---|---|
| master_url | Yes | ||
| self | Yes | ||
| site_url | Yes |
Implementation Reference
- Generic handler wrapper decorated as MCP tool (@mcp.tool()) that binds and executes the underlying LinkAnalysisService.add_connected_page method via dynamic getattr.# 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:179-181 (registration)Specific registration of the 'add_connected_page' tool by wrapping the 'links' service's 'add_connected_page' method, preserving signature and docstring.add_connected_page = wrap_service_method( # noqa: F841 mcp, service, "links", "add_connected_page" )
- mcp_server_bwt/main.py:17-17 (registration)Invokes the function that registers all Bing Webmaster tools, including 'add_connected_page', to the MCP server.add_bing_webmaster_tools(mcp, bing_service)
- Initializes the 'links' service instance (LinkAnalysisService) used by the add_connected_page tool handler.self.links = link_analysis.LinkAnalysisService(self.client)
- Maps the 'links' service attribute to its class for dynamic method lookup in the wrapper."links": link_analysis.LinkAnalysisService,