fetch_url
Submit URLs to Bing for immediate crawling and indexing through the Bing Webmaster Tools API. This tool triggers prompt URL fetching to update search engine results.
Instructions
Request Bing to fetch a specific URL immediately.
Args: site_url: The URL of the site url: The URL to fetch
Raises: BingWebmasterError: If URL cannot be fetched
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| self | Yes | ||
| site_url | Yes | ||
| url | Yes |
Implementation Reference
- The generic handler wrapper function for all service methods, including fetch_url. Decorated with @mcp.tool() and calls the underlying SubmissionService.fetch_url 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:113-113 (registration)Specific registration of the 'fetch_url' tool by wrapping the submission service's fetch_url method.fetch_url = wrap_service_method(mcp, service, "submission", "fetch_url") # noqa: F841
- mcp_server_bwt/main.py:17-17 (registration)Invokes the function that registers all Bing Webmaster tools, including 'fetch_url', to the MCP server.add_bing_webmaster_tools(mcp, bing_service)
- Initializes the SubmissionService instance (containing fetch_url implementation) as part of BingWebmasterService __aenter__.self.submission = submission.SubmissionService(self.client)