Skip to main content
Glama
zizzfizzix

Bing Webmaster Tools MCP Server

by zizzfizzix

get_sites

Retrieve a list of sites associated with your Bing Webmaster Tools account to manage web properties, monitor performance, and analyze site data.

Instructions

Retrieve all sites in the user's Bing Webmaster Tools account.

Returns: List[Site]: List of sites associated with the account

Raises: BingWebmasterError: If the API request fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selfYes

Implementation Reference

  • The handler logic for the get_sites tool (shared with other tools). It enters the service context, retrieves the 'sites' service object, calls its 'get_sites' method with the provided arguments, and returns the result. The signature and docstring are copied from the original method for schema inference.
    @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
  • Registers the 'get_sites' tool by invoking wrap_service_method, which applies @mcp.tool() decorator to a wrapper function specific to sites.get_sites.
    get_sites = wrap_service_method(mcp, service, "sites", "get_sites") # noqa: F841
  • Invokes the function that registers all Bing Webmaster tools, including 'get_sites'.
    add_bing_webmaster_tools(mcp, bing_service)
  • Creates the 'sites' service instance (SiteManagementService) used by the get_sites handler.
    self.sites = site_management.SiteManagementService(self.client)
  • Maps the 'sites' attribute to SiteManagementService class for use in wrap_service_method.
    "sites": site_management.SiteManagementService,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zizzfizzix/mcp-server-bwt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server