get_sites
Retrieve all websites registered in your Bing Webmaster Tools account to manage and monitor their search performance.
Instructions
Retrieve all sites in the user's Bing Webmaster Tools account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_server_bwt/main.py:132-142 (handler)The main handler function for the 'get_sites' tool. It uses the global 'api' instance to make a request to the Bing Webmaster API's 'GetUserSites' endpoint and processes the response by adding MCP-compatible type fields.async def get_sites() -> List[Dict[str, Any]]: """ Retrieve all sites in the user's Bing Webmaster Tools account. Returns: List of sites with their details including URL, verification status, etc. """ async with api: sites = await api._make_request("GetUserSites") return api._ensure_type_field(sites, "Site")
- mcp_server_bwt/main.py:128-131 (registration)The @mcp.tool decorator that registers the 'get_sites' function as an MCP tool with the specified name and description.@mcp.tool( name="get_sites", description="Retrieve all sites in the user's Bing Webmaster Tools account", )
- mcp_server_bwt/main.py:112-120 (helper)Helper method in BingWebmasterAPI class used by get_sites to add '__type' fields to the response data for MCP compatibility.def _ensure_type_field(self, data: Any, type_name: str) -> Any: """Ensure __type field is present for MCP compatibility.""" if isinstance(data, list): for item in data: if isinstance(item, dict) and "__type" not in item: item["__type"] = f"{type_name}:#Microsoft.Bing.Webmaster.Api" elif isinstance(data, dict) and "__type" not in data: data["__type"] = f"{type_name}:#Microsoft.Bing.Webmaster.Api" return data